Template:Template HD
From 2009.igem.org
(Difference between revisions)
Naoiwamoto (Talk | contribs) |
Naoiwamoto (Talk | contribs) m |
||
Line 408: | Line 408: | ||
</style> | </style> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | var | + | var url = window.location |
+ | var myNavi, myNaviElement, myNaviLink; | ||
- | for (i=0; i< | + | // get navi bar |
- | { | + | myNavi = document.getElementById('navi'); |
- | + | ||
- | + | // main entries in navi menu | |
- | + | myNaviElement = myNavi.children[0].children[0]; // first li | |
- | document. | + | |
- | + | myNaviLink; | |
+ | for (i = 0; i < myNavi.children[0].children.length; i++) { | ||
+ | myNaviLink = myNaviElement.children[0]; // first a in li | ||
+ | if (myNaviLink.href == url.href) { | ||
+ | myNaviLink.style.color = 'red'; | ||
+ | // change some image based on id here... | ||
+ | /* | ||
+ | someImage = document.getElementById('someImage'); | ||
+ | someImage.src = 'path/to/image'; | ||
+ | */ | ||
+ | } | ||
+ | myNaviElement = myNaviElement.nextElementSibling; | ||
} | } | ||
Revision as of 21:16, 6 October 2009