javascript - How to fade to a different image on mouse over? -
i have 2 images. configure them when mouseover default image, fades second image. how 1 go this?
thanks!
i've assumed want fade in when mouseout, here's getting started with.
// markup <div id="imgs"> <img src="..." id="i1"> <!-- mouseover image --> <img src="..." id="i2"> <!-- default image --> </div> // css img { display:block; position:absolute; top: 0; left: 0; } // jquery $(function() { $('#imgs') .mouseenter(function() { $('#i2').fadeout('slow'); }) .mouseleave(function() { $('#i2').fadein('slow'); }); });
Comments
Post a Comment