Jquery Assistance...
Date: 09/03/07
(Web Development) Keywords: css
I'm trying to write a lil' script to expand a hidden div and swap the image (think click on '?' and '?' becomes a pressed state).
the only problem I'm having is - the text expands/disappears fine, but the image will only swap once (and also it swaps all the images, not just the one clicked!)
Anyone have any pointers?
$(document).ready(function() {
$('div.formHelp > div').hide();
$('div.formHelp > img').click(function() {
$(this).next('div').toggle('normal');
$("img").attr("src","/images/css/formHintButtonSelected.gif");
return false;
});
});
Source: http://community.livejournal.com/webdev/433848.html