Guest User

Untitled

a guest
Jan 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. <aside id="sb-popular">
  2. <p class="sb-popular-nav">
  3. <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>
  4. <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>
  5. <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>
  6. <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>
  7. </p>
  8. <div id="sbp-latest">
  9. Content here
  10. </div>
  11. <div id="sbp-commented">
  12. Content here
  13. </div>
  14. <div id="sbp-popular">
  15. Content here
  16. </div>
  17. <div id="sbp-views">
  18. Content here
  19. </div>
  20. </aside>
  21.  
  22. function hidediv(d) { document.getElementById(d).style.display = "none"; }
  23. function showdiv(d) { document.getElementById(d).style.display = "block"; }
  24. function tabset(d) { document.getElementById(d).style.color = "white";}
  25. function taboff(d) { document.getElementById(d).style.color = "black";}
  26.  
  27. function showDiv() {
  28. .
  29. .
  30. .
  31. return false
  32. }
  33.  
  34. <a href="#" onclick="return showDiv('....')"
  35.  
  36. window.onload=function() {
  37. var links = document.getElementById('sb-popular').document.getElementsByTagName('a');
  38. for (...) {
  39. links[i].onclick=function() {
  40. ..
  41. ..
  42. ..
  43. }
  44. }
  45. }
Add Comment
Please, Sign In to add comment