Template:Paris/Menu
From 2008.igem.org
(Difference between revisions)
Line 126: | Line 126: | ||
window.onload=function(){ | window.onload=function(){ | ||
toggleNextByTagAndClassName('div','toggleswitch'); | toggleNextByTagAndClassName('div','toggleswitch'); | ||
- | + | } | |
+ | |||
+ | <!-- bypass the TOC toggling! (the TOC is always collapsed at the page loading)--> | ||
+ | function showTocToggle() { | ||
+ | if (document.createTextNode) { | ||
+ | var linkHolder = document.getElementById("toctitle"); | ||
+ | if (!linkHolder) { | ||
+ | return; | ||
+ | } | ||
+ | var outerSpan = document.createElement("span"); | ||
+ | outerSpan.className = "toctoggle"; | ||
+ | var toggleLink = document.createElement("a"); | ||
+ | toggleLink.id = "togglelink"; | ||
+ | toggleLink.className = "internal"; | ||
+ | toggleLink.href = "javascript:toggleToc()"; | ||
+ | toggleLink.appendChild(document.createTextNode(tocHideText)); | ||
+ | outerSpan.appendChild(document.createTextNode("[")); | ||
+ | outerSpan.appendChild(toggleLink); | ||
+ | outerSpan.appendChild(document.createTextNode("]")); | ||
+ | linkHolder.appendChild(document.createTextNode(" ")); | ||
+ | linkHolder.appendChild(outerSpan); | ||
+ | var cookiePos = document.cookie.indexOf("hidetoc="); | ||
+ | <!--if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1) { | ||
+ | toggleToc(); | ||
+ | }--> | ||
+ | } | ||
} | } | ||
</script> | </script> |
Revision as of 07:27, 30 October 2008