开发者

How to cause same effect of child on parent

开发者 https://www.devze.com 2023-03-22 23:00 出处:网络
i开发者_如何学JAVAs there a way to cast the same effect of a child on a parent? <div id = \"parent\">

i开发者_如何学JAVAs there a way to cast the same effect of a child on a parent?

<div id = "parent">    
    <div id = "child">
    </div>
    //button.click to .show("slide") child
</div>

How can I cast that same effect on the parent for the same event fired?


Something like this:

$("#child").click(function() {
    $(this).slideToggle(function() {
        $(this).parent().slideToggle();
    });
});

or this:

$("#child").click(function() {
    $(this).parent().slideToggle();
});


try trigger it

0

精彩评论

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