自动计算当前页面功能

This commit is contained in:
wlx 2013-03-26 14:22:40 +00:00
parent 621d42ee34
commit e036cea853
2 changed files with 13 additions and 10 deletions

View File

@ -8,6 +8,7 @@
<link href="/js/lib/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen"> <link href="/js/lib/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<script src="/js/lib/jquery.lasted.js"></script> <script src="/js/lib/jquery.lasted.js"></script>
<script src="/js/lib/bootstrap/js/bootstrap.min.js"></script> <script src="/js/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="/js/navi.js"></script>
<?= $this->headScript() ?> <?= $this->headScript() ?>
<?= $this->headLink() ?> <?= $this->headLink() ?>
<?= $this->headStyle() ?> <?= $this->headStyle() ?>
@ -18,6 +19,7 @@
<body> <body>
<div class="container"> <div class="container">
<?= $this->render('header.phtml') ?> <?= $this->render('header.phtml') ?>
<!--<div class="breadcrumb"><?= $this->breadcrumb() ?> </div>-->
<?= $this->layout()->content ?> <?= $this->layout()->content ?>
<?= $this->render('footer.phtml') ?> <?= $this->render('footer.phtml') ?>
</div> </div>
@ -33,4 +35,5 @@
piwikTracker.enableLinkTracking(); piwikTracker.enableLinkTracking();
} catch( err ) {} } catch( err ) {}
</script><noscript><p><img src="http://piwik.westgis.ac.cn/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript> </script><noscript><p><img src="http://piwik.westgis.ac.cn/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript>
<script>setPage();</script>
</html> </html>

View File

@ -15,8 +15,8 @@ function extractPageName(hrefString)
{ {
if (arr[i].parentNode.tagName != "DIV") if (arr[i].parentNode.tagName != "DIV")
{ {
arr[i].className = "current"; arr[i].className = "active";
arr[i].parentNode.className = "current"; arr[i].parentNode.className = "active";
} }
} }
} }
@ -26,6 +26,6 @@ function extractPageName(hrefString)
{ {
hrefString = document.location.href ? document.location.href : document.location; hrefString = document.location.href ? document.location.href : document.location;
if (document.getElementById("divNavi")!=null) if (document.getElementById("mainmenu")!=null)
setActiveMenu(document.getElementById("divNavi").getElementsByTagName("a"), extractPageName(hrefString)); setActiveMenu(document.getElementById("mainmenu").getElementsByTagName("a"), extractPageName(hrefString));
} }