That help quite a bit but still not the effect i am looking for.  I know this
is ironic but i am looking for the effect on this home page on the right
hand side:

http://mootools.net/

The thing that that effect has and this one does not is the is stops the
effect once the mouse leaves if i move over a link real fast and then leave
it.  in my code it perform the full effect even if my mouse is over it right
away.  is there a way to stop the effect from fully complete if the mouse is
move in and then out real fast?


Joel Birch wrote:
> 
> On 8/14/07, Joel Birch <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> On 8/14/07, Eridius <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > is there anything wring with that code(i don't care about use
>> > mouseover()
>> > instead of bind() because i did to test things)?
>> >
>> >
>> It seems to work fine for me, although I would use hover() in order to
>> eliminate the buggy behaviour of mouseout firing sometimes when you hover
>> over the child a element. Also, you don't need to wrap self in a new
>> object,
>> or even have that variable at all. Here is my optimisation:
>>
>> jQuery.fn.hover_menu = function(offset, speed){
>>    this.children('li').each(function(){
>>        var $$ = $(this); //only create this once and use many times
>>
>>        //I'm not familiar with parseFloat, didn't know you could pass in
>> two parameters. Also not sure if you need it here.
>>        var current_margin = parseFloat($$.css('margin-left'), 10);
>>        var new_margin = parseFloat(current_margin + offset, 10);
>>
>>        $$.hover(
>>            function(){ $$.animate({paddingLeft: new_margin}, speed);},
>>            function(){ $$.animate({paddingLeft: current_margin},
>> speed););
>>        );
>>    });
>> };
>>
>> Untested.
>> Joel Birch
>>
> 
> Once again I should have checked it properly before sending. I have a );
> where I should have a } in the hover function.
> 
> 
> jQuery.fn.hover_menu = function(offset, speed){
>    this.children('li').each(function(){
>        var $$ = $(this); //only create this once and use many times
> 
>        //I'm not familiar with parseFloat, didn't know you could pass in
> two
> parameters. Also not sure if you need it here.
>        var current_margin = parseFloat($$.css('margin-left'), 10);
>        var new_margin = parseFloat(current_margin + offset, 10);
> 
>        $$.hover(
>            function(){ $$.animate({paddingLeft: new_margin}, speed);},
>            function(){ $$.animate({paddingLeft: current_margin}, speed);}
>        );
>    });
> };
> 
> 

-- 
View this message in context: 
http://www.nabble.com/What-is-wrong-with-this-code--tf4264306s15494.html#a12136705
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to