snuviscript.js 597 B

12345678910111213141516
  1. var sections = document.getElementsByTagName("section");
  2. var menuHTML = "<div class='menu'>";
  3. for(var i = 0; i < sections.length - 1; i++)
  4. {
  5. menuHTML += "<a href='#" + sections[i].id + "'><span class='whitePipe'>" + sections[i].id + "</span></a>";
  6. }
  7. for(var i = sections.length - 1; i < sections.length; i++)
  8. {
  9. menuHTML += "<a href='#" + sections[i].id + "'><span>" + sections[i].id + "</span></a>";
  10. }
  11. menuHTML += "</div>";
  12. for(var i = 0; i < sections.length; i++)
  13. {
  14. sections[i].innerHTML = "<div class='snuviTitle'>" + sections[i].id + "</div>" + menuHTML + sections[i].innerHTML;
  15. }