jQuery accordion slideToggle problem -
i have accordion html loads live via ajax in div. div has close button can remove dom when clicked. when div created again without reloading page slidetoggle triggers twice , down , hides content.
here html loaded via ajax:
<div id="slidetoggle"> <h3>title</h3> <p>content</p> <h3>title</h3> <p>content</p> *..and on..* </div>
here jquery:
$("#slidetoggle p:not(:first)").hide(); $("#slidetoggle h3").live('click', function(){ $(this).next("p").slidetoggle("slow").siblings("p:visible").slideup("slow"); });
thanks in advance!
use .die() when remove nodes dom.
Comments
Post a Comment