Home ยป How do I make a rollover using png and jquery?

How do I make a rollover using png and jquery?

$(document).ready(function()
{
$(“img.b”).hover(
function() {
$(this).stop().animate({“opacity”: “1”}, “slow”);
},
function() {
$(this).stop().animate({“opacity”: “0”}, “slow”);
});

});
</script>

<style>
div.fadehover {
    position: relative;
    }

img.b {
    position: absolute;
    left: 0;
    top: 0;

        z-index: 10;
    }

img.a {
    position: absolute;
    left: 0;
    top: 0;
    }
</style>

<div class=”fadehover”>
<a href=””><img src=”portfolio_a.png” alt=”” class=”a” />
<img src=”portfolio_b.png” alt=”” class=”b” /></a>

</div>

img.b {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    opacity: 0;
    filter: alpha(opacity=0);
}

Add Comment

Click here to post a comment

Your email address will not be published. Required fields are marked *