开发者

mootools transpose code from Jquery

I need to transpose a Jquery script to Mootools, but I don't manage to get it working. Here's the jquery code:

$('.block-menu').hover(function(){
    $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:400});
}, function() {
    $(".cover", this).stop().animate({top:'185px'},{queue:false,duration:400});
});

I have a series of images that should be covered 开发者_JAVA百科by a div when you hover over the image. This code does exactly that: ".cover" is the class of the div that covers up the image, while ".block-menu" is the div that holds the image. Everything's working fine in Jquery, but I don't know how to transpose this to Mootools. This is the code I have tired to use so far (just to get the hove over part working):

$$('.block-menu').addEvent('mouseenter', function() {
    var cov = $(this).getElements('.cover');
    cov.set('tween', {
            duration: 1000,
            transition: Fx.Transitions.Bounce.easeOut
        }).tween('top', '0px');;        
});

But unfortunately I get the following error in my Firebug console:

String contains an invalid character" code: "5
[Interrompi per questo errore] return result;},getStyles:function(){r...hild);return this.appendText(text);}} 

I probably taking the wrong approach to the problem. Any idee how to get this code working?

Thanks! Roberto Pravisani Creative Chaos

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜