Response title
This is preview!
<img id="picture" src="first.png" data-othersrc="second.png">
$(document).ready(function() {
$("#picture").load(function() {
$(this).fadeIn();
}).click(function() {
$(this).fadeOut("fast", function() {
var temp = this.src;
this.src = this["data-othersrc"];
this["data-othersrc"] = temp;
});
});
});
--
Šime Vidas
http://www.w3viewer.com
Yea, you can use the alt attribute, that should be OK.
But, I tested my code and it worked, so I am curious why it didn't work for you....
--
Šime Vidas
http://www.w3viewer.com
© 2013 jQuery Foundation
Sponsored by and others.