Hi Mike,

You just need to tweak the JQuery syntax a little to refer to 'this' instead
of e.target:

Change from:

    $("a.folder").toggle(function(e) {
       $(e.target).parent().next().slideDown('fast');
    }, function(e) {
       $(e.target).parent().next().slideUp('fast');
    });

To

    $("a.folder").toggle(function(e) {
       $(this).parent().next().slideDown('fast');
    }, function(e) {
       $(this).parent().next().slideUp('fast');
    });

JQuery very cleverly makes 'this' available to your functions. You'll no
longer need the 'e' event parameter.

You can also do away with the parent() method like this $("..",
this).next().slideUp('fast')

Cheers,

George



Mika Tuupola wrote:
> 
> While converting from prototype + script.aculo.us to jQuery +  
> interface I now have a problem with nested divs and slideUp /  
> slideDown functions. To me it seems these efects don't transfer the  
> heigh to parent div. Check these two examples.
> 
> initially display: none;
> http://www.appelsiini.net/~tuupola/jquery/slideupdown/slideupdown.html
> 
> initially display: block;
> http://www.appelsiini.net/~tuupola/jquery/slideupdown/slideupdown2.html
> 
> Is this problem more with html or with jQuery?
> 
> -- 
> Mika Tuupola
> http://www.appelsiini.net/~tuupola/
> 
> 
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/slideUp---slideDown-and-nested-divs-tf2357182.html#a6566750
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to