Something like this might work better for you.

$('toolbar').addEvents(
{
        'mouseover': function() { $('toolbar').fadeIn(); },
        'mouseout':   function() { $('toolbar').fadeOut(); }
});

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of jk119
Sent: Friday, April 29, 2011 4:16 PM
To: MooTools Users
Subject: [Moo] Fade in Fade out div on hover

am i doing this all wrong?

//Use the fad in out callback
$("#toolbar").hover(function () {
    $(".image").fadeOut("slow", function () {
        $(this).addClass("imagehover").fadeIn("slow", function () {
            $(this).removeClass("imagehover");
        });
    });

});
</script>


<style type="text/css">
.imagehover{

        background:url(test.png);
        width:200px;
        height:200px;
}

.image{
        background:url(main.png);
        width:200px;
        height:200px;
}

</style>
</head>

<body>

<div id="toolbar">
<div class="image" id="toolbar"></div>
</div>
</body>
</html>

Reply via email to