Hi Dave,
You can store the initial src in a variable and use that later. Also,
you might find the .hover() method helpful here:
var mysrc = '';
$('.myClass').hover(function() {
mysrc = $(this).attr('src');
$(this).attr('src', 'over.gif')
}, function() {
$(this).attr('src', mysrc);
});
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Apr 29, 2008, at 10:41 PM, [EMAIL PROTECTED] wrote:
Hi,
I have several images on my page, each with class "myClass". I know
when I roll over each image, I want its source to be "over.gif".
However, when I roll out I want the image to be whatever was there
before, and it will be different for each image. How can I construct
mouseover/mouseout handlers to accommodate this?
Here are the handlers I'll presumably be using
$('.myClass').mouseover( function(){ $
(this).attr("src", $(this).attr("src", "over.gif") } );
$('.myClass').mouseout( function(){ $
(this).attr("src", $(this).attr("src", ???) } );
Thanks, - Dave