停止 jQuery 事件函数
我昨天发布了一个问题,该问题已得到解答,但遗憾的是,我现在对上述代码遇到了一个新问题,并且正在寻找一些善良的灵魂来为我指明正确的方向,这样我就可以学习如何解决问题,这样我就不需要再次寻求该问题的帮助。
的 jsfiddle 链接 http://jsfiddle.net/EzYeH/10/
这是脚本 我试图实现的目标是,如果事件函数 shrink 仍在运行,则停止事件函数 expand 初始化。
我尝试使用和阅读 .stopPropagation()
& .stop()
但无法正确实现。
提前感谢任何能够解决这个问题的人,
丹。
I posted a question yesterday which was answered, sadly though I now have a new issue with the said code and am looking for some kind soul to point me in the right direction so I can learn how to get the issues fixed so I dont need to ask for help in the issue again.
Here is the jsfiddle link to the script http://jsfiddle.net/EzYeH/10/
What I am trying to achieve is to stop the event function expand initialising if the event function shrink is still running.
I have tried using and reading up on .stopPropagation()
& .stop()
but cannot get the implementation correct.
Thanks in advance anyone who can tackle this,
Dan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 http://jsfiddle.net/EzYeH/13/ 了解更新的代码:
有几个问题:您的
$this
变量是隐式全局变量,这导致了布局问题。您确定当前状态并不是为了让您确定扩展或收缩是否合适。
See http://jsfiddle.net/EzYeH/13/ for updated code:
A couple of issues: your
$this
variable was implicitly global, which was causing layout problems.You were not determining the current state to let you figure out whether an expand or shrink was appropriate.