停止 jQuery 事件函数

发布于 2024-12-28 10:43:04 字数 436 浏览 3 评论 0原文

我昨天发布了一个问题,该问题已得到解答,但遗憾的是,我现在对上述代码遇到了一个新问题,并且正在寻找一些善良的灵魂来为我指明正确的方向,这样我就可以学习如何解决问题,这样我就不需要再次寻求该问题的帮助。

的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

有木有妳兜一样 2025-01-04 10:43:04

请参阅 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文