我给section里的标签都邦定了click事件,
我想点其中的input时取消其它标签的绑定事件,
再点击p点才重新恢复其它的事件绑定功能,
这个要怎么改,我下面不行,取消绑定事件就绑不回来了!!!
font
span
p
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
<script> $(function(){ var flag; $("input").bind("click",function(){ flag=fasle; $("p").show(function(){ $(this).click(function(){ flag=true; $(this).hide(); }) }); }); $("font").bind("click",function(){ if(flag){ alert("font"); } }); $("span").bind("click",function(){ if(flag){ alert("font"); } }); }) </script>
你的绑定的事件处理函数独立为一个函数就OK啦~~~
point-event:none
把绑定的事件拿出来,写成一个函数