Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aside id="sb-popular">
- <p class="sb-popular-nav">
- <a id="sbpt1" class="current" href="javascript:showdiv('sbp-latest'); hidediv('sbp-commented'); hidediv('sbp-popular'); hidediv('sbp-views'); tabset('sbpt1'); taboff('sbpt2'); taboff('sbpt3'); taboff('sbpt4');">Latest</a>
- <a id="sbpt2" href="javascript:showdiv('sbp-commented'); hidediv('sbp-latest'); hidediv('sbp-popular'); hidediv('sbp-views'); tabset('sbpt2'); taboff('sbpt1'); taboff('sbpt3'); taboff('sbpt4');">Commented</a>
- <a id="sbpt3" href="javascript:showdiv('sbp-popular'); hidediv('sbp-commented'); hidediv('sbp-latest'); hidediv('sbp-views'); tabset('sbpt3'); taboff('sbpt1'); taboff('sbpt2'); taboff('sbpt4');">Popular</a>
- <a id="sbpt4" href="javascript:showdiv('sbp-views'); hidediv('sbp-commented'); hidediv('sbp-popular'); hidediv('sbp-latest'); tabset('sbpt4'); taboff('sbpt2'); taboff('sbpt3'); taboff('sbpt1');">Views</a>
- </p>
- <div id="sbp-latest">
- Content here
- </div>
- <div id="sbp-commented">
- Content here
- </div>
- <div id="sbp-popular">
- Content here
- </div>
- <div id="sbp-views">
- Content here
- </div>
- </aside>
- function hidediv(d) { document.getElementById(d).style.display = "none"; }
- function showdiv(d) { document.getElementById(d).style.display = "block"; }
- function tabset(d) { document.getElementById(d).style.color = "white";}
- function taboff(d) { document.getElementById(d).style.color = "black";}
- function showDiv() {
- .
- .
- .
- return false
- }
- <a href="#" onclick="return showDiv('....')"
- window.onload=function() {
- var links = document.getElementById('sb-popular').document.getElementsByTagName('a');
- for (...) {
- links[i].onclick=function() {
- ..
- ..
- ..
- }
- }
- }
Add Comment
Please, Sign In to add comment