Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <img id="img" src="cat.jpg" />
- $('#img').toggle(
- function(){
- $(this).attr('src', 'dog.jpg');
- },
- function(){
- $(this).attr('src', 'cat.jpg');
- }
- );
- var images = ["hackanm.gif", "compman.gif"];
- var index = 0;
- function changeSrc() {
- document.getElementById("myImage").src = images[index];
- index = (index + 1) % images.length;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement