我有这个html / css代码:
<body> <!-- BEGIN: HEADER AREA --> <?PHP require("snippets/header_area.PHP"); ?> <!-- END: HEADER AREA --> <div id = "presentation_area"> <div id = "submenu_area"> <div id = "sliding_menu_area"> </div> <div id = "tags"> <div id = "1"> <img src = "lang/el/images/1.png" /> </div> <div id = "2"> <img src = "lang/el/images/2.png" /> </div> <div id = "3"> <img src = "lang/el/images/3.png" /> </div> <div id = "4"> <img src = "lang/el/images/4.png" /> </div> </div> </div> </div> </body>
当用户点击除#sub_menu_area之外的所有其他内容时,我试图触发一个函数.我使用js的以下部分:
$('*').not('#submenu_area').click(function(){ if(slide == "open"){ $('#sliding_menu_area').toggle(effect); slide = "close"; } });
不幸的是,孩子们不知何故不被排除在外,并且点击它会翻转很多次.有谁知道如何正确地做到这一点?! 原文链接:https://www.f2er.com/jquery/177713.html