我的 JavaScript 中有以下启动;顺便说一句,我总是使用 github 中显示的代码。完整的代码可以在这里看到
var
/* Application Specific Variables */
contentSelector = '.tab-content,.page-content,article:first,.article:first,.post:first',
$content = $(contentSelector).filter(':first'),
contentNode = $content.get(0),
$menu = $('#menu,#nav-sub,.nav,.nav-sub:first').filter(':first'),
activeClass = 'active selected current youarehere open',
activeSelector = '.active,.selected,.current,.youarehere, .open',
menuChildrenSelector = '> li,> ul > li',
/* Application Generic Variables */
$body = $(document.body),
rootUrl = History.getRootUrl(),
scrollOptions = {
duration: 800,
easing:'swing'
};
问题在于:
contentSelector = '.tab-content,.page-content,article:first,.article:first,.post:first',
并在:
$menu = $('#menu,#nav-sub,.nav,.nav-sub:first').filter(':first'),
当菜单点击进去时.nav
,不得不改变.page-content
。
单击菜单时.nav-sub
,必须将内容替换为.tab-content
问题是,两个菜单都发生了变化.page-content
,而不仅仅是选项卡内容或页面内容。
知道如何改变这个吗?