本文介绍了jQuery:仅运行一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是的,我有一个fancybox.如果?mode = new
Yes i have an fancybox. It auto opens if ?mode=new
在?mode = new上发生的是:
What happens on ?mode=new is:
<script> $(document).ready(function(){ $('#newPM').click(); }); </script>打开正常.但是,当您单击该元素时,该元素将保持关闭/打开状态,因为这已激活.那我怎么只能运行一次呢?
It opens fine. But when you then click on the element, it keeps closing/open, because this is activated. So how can i only run this once?
推荐答案您是说它不断打开和关闭fancybox吗?您可以
Do you mean it keeps opening and closing the fancybox? You can do
$("#newPM").unbind("click");这将删除onclick事件,使其不再被触发.
This will remove the onclick event so it doesn't get triggered anymore.
更多推荐
jQuery:仅运行一次
发布评论