删除可排序 Jquery 选项卡问题
我已经整理了这个问题的演示。
基本上,排序后错误的选项卡就会被删除。并非所有排序都会产生问题,因此请按照我在 JSFiddle JavaScript 部分中的示例进行操作。我有两个有趣的例子:
http://jsfiddle.net/GM9BQ/ (相当长的演示)
< a href="http://jsfiddle.net/GM9BQ/7/" rel="nofollow">http://jsfiddle.net/GM9BQ/7/ (大大缩短)
http://jsfiddle.net/GM9BQ/13/ (与 7(上面)相同,但使用href)
两者都显示不同的问题。
这些问题已经存在很长时间了,我在即将发布的 1.9 版本中也看到了这个问题。
因此,如果有人可以帮助解决这个问题,我将不胜感激。
ps 我也在 jquery 论坛发了一个帖子。
I have put together a demo of the issue.
Basically the wrong tab is removed after sorting. Not all sorting creates the problem so follow my example in the JSFiddle JavaScript section. I have two examples of funny business:
http://jsfiddle.net/GM9BQ/ (rather long demo)
http://jsfiddle.net/GM9BQ/7/ (considerably shortened)
http://jsfiddle.net/GM9BQ/13/ (Same as 7 (above) but removes tab using the href)
Both show different problems.
These have been an issue for ages now and I see the issue in the upcoming 1.9 release too.
So if anyone can help resolve this, I'd be much appreciated.
p.s. I made a post at the jquery forum too.
http://forum.jquery.com/topic/jquery-tabs-wrong-tab-removed-after-sorting
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现该事件被多次触发,因此我添加了基本检查。您还可以根据选项卡数量实施检查。
请检查http://jsfiddle.net/GM9BQ/1/。
请注意,我删除了一些代码以简化调试。
希望它会有所帮助。
I found that the event was getting fired multiple times, so I added basic check. You can also implement check based on number of tabs.
Please check http://jsfiddle.net/GM9BQ/1/.
Note that the I removed some of the code to ease the debugging.
Hope it will help.
为了清楚起见,问题是选项卡已成功排序,但选项卡面板未排序。因此,答案是更新面板以镜像与其相应选项卡相同的位置。
感谢 Ajay 在上一篇文章中解决了这个问题。更新后的示例可以在这里查看。
http://jsfiddle.net/GM9BQ/23/
注意 addTabSortableEvent 函数更新方法。
For clarity, the issue is that the tab is successfully being sorted but the tab panel is not. The answer therefore is to update the panel to mirror the same position as its corresponding tab.
Thanks to Ajay for working this out in the previous post. The updated example can be seen here.
http://jsfiddle.net/GM9BQ/23/
Note the addTabSortableEvent functions update method.