[jQuery] Fade in background image.

[jQuery] Fade in background image.


Hi there!
I'd like to create an effect like the one on the jquery Ui website. Someone
hovers over an item and is changes its background color smoothly.
This is how far I've got:
$(".actionmenu").mouseover(function(){
    if($(this).css("background-image").length <= 4)
    {
        var obj = $(this).clone(true);
    
obj.insertAfter(this).hide().css({"background-image":"url(IMAGE)","background-repeat":"repeat-y"});
        $(this).hide();
        obj.fadeIn();
    }
});
$(".actionmenu").mouseout(function(){
    if($(this).css("background-image").length > 4)
    {
        $(this).hide();
        $(this).prev("div").fadeIn();
    }
});
It works.
The problem is, that if the user hovers too quickly, the js code can't keep
up with cloning and fading in that div so that the item vanishes. Check
yourself: http://inaustralia.de/fcms/admin.php
user/pass:operator
Any solutions?
--
View this message in context: http://www.nabble.com/Fade-in-background-image.-tp18336552s27240p18336552.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.