如何编写on click函数来隐藏除特定类之外的所有内容?

时间:2014-06-07 09:56:53

标签: javascript jquery

HTML:

<div class="jumbotron" id="{{simpler.id}}" class="parent{{simpler.parent_simpler}}"><h3>{{simpler.simpler}}</h3>
                <input type = "text" style="display:none;">{% csrf_token %}</input>
                <button type="button" class="btn-primary" style="display:none;">Add Simpler.</button>
            </div>  

JS:

$(".jumbotron").click(function(){
            var this_id = $(this).attr('id');
            var children_class = "parent"+ this_id;
            $(".jumbotron").toggle();
            $(this).toggle();
            $('.'+ children_class).toggle();
            $.scrollTo($(this).position().top, 500);
        });

但我屏幕上的一切都消失了,除了“这个”。

0 个答案:

没有答案