选项卡菜单 +手风琴菜单分配类别
我之前曾问过有关这两个菜单的问题,但主题有点不同,现在,我想要的只是升级此处编写的先前代码: 手风琴、选项卡菜单,为两者分配选择类,以便在我单击其子菜单中的链接后,类 open_menu 不会消失菜单,你可以通过这个脚本轻松理解它: http://jsfiddle.net/bq6tA/11/ 在评论中我试图回复编写此脚本的人,但他没有回复,但我现在确实需要修改此脚本,谢谢大家的帮助! 顺便说一句,如果我刷新页面,类就分配好了,一旦我单击子菜单链接,顶部菜单链接的 open_menu 类就会消失。
I have asked question about these two menus before, but the subject was a bit different, for now, all i want is to upgrade the previous code written here: accordion, tab menus, assign select class for both so that the class open_menu doesnt disappear after i click the link in it's sub menu, u can easily understand it from this script: http://jsfiddle.net/bq6tA/11/ in comments i tried to reply the man who wrote this script, but he didn't reply, but i really need to modify this script, right now, and thx for help everyone!
btw, if i refresh the page, the classes are assigned ok, once i click the sub menu link, the class open_menu for top menu link disappear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
tabcontent.js 的第 86 行循环遍历列表结构中的每个项目,并删除所有样式类(如果它们不是当前选定的项目):
添加一个额外的单击绑定器以将其重新应用于每个最低级别的项目:
在此处查看工作演示。
Line 86 of tabcontent.js is looping through every item in your list structure and removing all styling classes if they're not the currently selected item:
Add an additional click binder to reapply it for each lowest level item:
See a working demo here.
您可以简单地从代码中删除
.removeClass('open_menu')
吗?Can you simply remove the
.removeClass('open_menu')
from the code?