Help with jquery animate()
Posted
by andrei
on Stack Overflow
See other posts from Stack Overflow
or by andrei
Published on 2010-06-17T12:47:30Z
Indexed on
2010/06/17
12:53 UTC
Read the original article
Hit count: 166
jQuery
I'm using this code to change opacity when user is on and off a picture unfortunately when the user clicks the image the opacity does not stay at 1. Anyone has an answer ?
$(document).ready(function(){
$('img#slide').animate({"opacity" : .7})
$('img#slide').hover(function(){
$(this).stop().animate({"opacity" : 1})
}, function(){
$(this).stop().animate({"opacity" : .7})
});
$('img#slide').click(function(){
$(this).animate({"opacity" : 1});
});
});
© Stack Overflow or respective owner