« slightestBox (lightbox/litebox replacement) How I Spent My Winter Vacation »
jQuery Image Swap
jQuery does a fantastic job at simplifying JavaScript. Below is an example for those of you still relying on DreamWeaver’s Image Rollover (MM Image Swap). The better alternative is using proper image replacement techniques.
$('img#nav1').hover(function() {
$(this).attr("src","/images/headerNav/1-over.gif");
}, function() {
$(this).attr("src","/images/headerNav/1.gif");
});
<img src="1.gif" id="nav1" />
And there you have it! Coming up next is the SEO case study of duffynewport.com.
Friday, October 12th, 2007 at 11:28 am and is filed under i came as a rant, jQuery, work. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
October 5th, 2008 at 11:41 am
Wow, man, this is the *only* comprehensive rollover technique I could dig up in several hours worth of googling. No kidding, try “jquery simple rollover” and look at what the cat drags in. Boy, thank you very much. Now what I’d like to know is how to trigger those crazed smooth state transitions that jquery can do, you know the last argument, slide, wipe, all that jazz..?