Jquery Issue
Date: 09/04/07
(Javascript Community) Keywords: css
I'm writing code so that you click on an image, and it shows a hidden div and swaps the image.
Currently, it animates the hidden div, and swaps the image to the new image, but I can't get it to swap back!
Any pointers?
$(document).ready(function() {
$('div.formHelp > div').hide();
$('div.formHelp > img').click(function() {
$(this).next('div').toggle('normal');
if
($(this).attr("src","/images/css/formHintButton.gif"))
($(this).attr("src","/images/css/formHintButtonSelected.gif"))
else
($(this).attr("src","/images/css/formHintButtonSelected.gif"))
($(this).attr("src","/images/css/formHintButton.gif"))
return false;
});
});
Source: http://community.livejournal.com/javascript/140135.html