ok i patched ist to this one
but the first time i click it
the alert in my .ajaxComplete says NULL to me
even if i try to click it oncemore it works with strange effects
both of the comments fold out.

i just want to load the comments one time an then fold them in and out...


// JavaScript Document
$(document).ready(function(){
    $("[EMAIL PROTECTED]'kommentar\']").click(function(e){
        e.preventDefault();
        var href=$(this).href();
        var me = this;
       
        $.get(href,function(r) {   
            $(me).parent().append(r);
            $(me).next().hide();
        });
        $(this).ajaxComplete(function(){
            alert($(this).next().html());       
            $(this).next().slideDown("slow");
              $(this).html("hide comments");
            $(this).unbind("click");
            $(this).toggle(function(){
                $(this).next().slideUp("fast");
                $(this).html("show comments");
            },function(){
                $(this).next("div").slideDown("fast");
                $(this).html("hide comments");
            });
        });

    });
});

Klaus Hartl wrote:
> Blair McKenzie schrieb:
>   
>> I think you're html may be buggy. You shouldn't have DIVs or Ps nested 
>> inside other Ps. The outer P should be changed to a DIV. The inline 
>> styles you have on the outer P might also be involved. But I'm no CSS guru.
>>     
>
> Yes, because the block level elements inside the p cause browsers to 
> implicitly close that p and you end up with a completely different dom 
> tree than you might expect.
>
>
> -- klaus
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>   


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

Reply via email to