jQuery 手风琴在仍然有动画效果时无法禁用单击?
我正在尝试开发一个 jQuery 手风琴,考虑到我不太了解 jQuery,到目前为止它运行得很好。
我遇到的主要问题是,如果您在不同的部分上快速单击,它最终会在短时间内将整个手风琴击倒,这实际上还不够好。
我试图将
if ($("#accordion ul li").is(':animated')) {
放在 click 函数周围,但似乎没有做任何事情,任何人都可以帮我一把或告诉我是否可以至少是可能的吗?
您还会注意到,单击时,手风琴的右侧会收缩一点,这是可以修复的还是我必须忍受的东西?
您可以在这里查看我的意思 http://dev.boomeranginternet.co.uk/accordion /accordion1.asp
预先感谢您的帮助。
问候, J。
I've attempting to develop a jQuery accordion, which is work ing pretty well so far considering I don't really know jQuery.
The main problem i have is if you click about quite quickly on different sections it will eventially knock the whole accordion out for a short time which wouldn't be good enough really.
I attempted to put
if ($("#accordion ul li").is(':animated')) {
around the click function but didn't seem to do anything, could anyone give me a helping hand or tell me if it is at least possible?
Also you will notice that when clicked on, the right side of the accordion shrinks a little, is this fixable or just something i'll have to put up with?
You can view what i mean here http://dev.boomeranginternet.co.uk/accordion/accordion1.asp
Thanks in advance for any help.
Regards,
J.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样的事情:
Try something like this insted:
通过放置点击功能你的意思是这样的?
这是错误的方法,单击函数定义了一个事件处理程序。如果你想要你的动画
要仅在没有其他动画运行时运行,您必须检查事件处理程序内部,例如
by putting around the click function you mean like this?
thats the wrong way around, the click function defines an event handler. if you want your animation
to only run as long as no other animation is running you must check inside your event handler e.g.