Hi
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters.
I have a few of these:
$(".about").hover(function() {
$(this).attr("src","_img/nav/about_over.gif");
}, function() {
$(this).attr("src","_img/nav/about_off.gif");
});
$(".artists").hover(function() {
$(this).attr("src","_img/nav/artists_over.gif");
}, function() {
$(this).attr("src","_img/nav/artists_on.gif");
});
$(".help").hover(function() {
$(this).attr("src","_img/nav/help_over.gif");
}, function() {
$(this).attr("src","_img/nav/help_off.gif");
});
But would obviously like to pass the the title of the image ("about", artists", "help") so that I could cut down on repeated code.
Any help much appreciated.
Thanks
Ronnie