Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup() {
- //starter image
- image = createImg("welcome.gif");
- image.class('gif');
- //remove and then show new gif
- button.mousePressed(removeGif);
- button.mouseReleased(showGif);
- }
- function showGif() {
- image = createImg(currentGif);
- image.class('gif');
- }
- function removeGif() {
- a = selectAll('.gif');
- for (let i = 0; i < a.length; i++) {
- a[i].remove();
- }
- }
Add Comment
Please, Sign In to add comment