In jQuery I need to do an if statement to see if $this doesn’t contain the class ‘.selected’.

$(".thumbs").hover(function(){

$(this).stop().fadeTo("normal", 1.0);
},function(){
$(this).stop().fadeTo("slow", 0.3);

});

Basically when this function is run (on hover) I don’t want to perform the fades if the class ‘.selected’ has been appended to the div, this will mean that the image will be at full opacity to signify that it’s selected. Searched on Google to no luck even though it’s a simple question of how to use an IF statement…

7 Answers
7

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *