Hayla

Style 003

Jun 6th, 2020
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <b:if cond='data:blog.pageType == "item" or data:blog.pageType == "static_page"'>
  2. <!-- Blogger TOC -->
  3. <script type='text/javascript'>
  4. //<![CDATA[
  5. function bwstoc() {
  6. var bwstoc = i = headinglength = getheading = 0;
  7. headinglength = document.getElementById("post-toc").querySelectorAll("h2, h3, h4").length;
  8. if (headinglength > 0) {
  9. // Hanya Tampil Jika Ditemukan Minimal 1 Heading
  10. for (i = 0; i < headinglength; i++) {
  11. getheading = document.getElementById("post-toc").querySelectorAll("h2, h3, h4")[i].textContent;
  12. var bws_1 = getheading.replace(/[^a-z0-9]/gi," ");
  13. var bws_2 = bws_1.trim();
  14. var getHeadUri = bws_2.replace(/\s/g, "_");
  15. document.getElementById("post-toc").querySelectorAll("h2, h3, h4")[i].setAttribute("id", getHeadUri);
  16. bwstoc = "<li><a href='#" + getHeadUri + "'>" + getheading + "</a></li>";
  17. document.getElementById("bwstoc").innerHTML += bwstoc;
  18. }
  19. } else { document.write("<style>.bwstoc{display:none !important;visibility:hidden !important;width:0 !important;height:0 !important;}</style>"); }
  20. }
  21. function bwstocShow() {
  22. var bwstocBtn = document.getElementById('bwstoc');
  23. var bwstocWrapID = document.getElementById('bwstocwrap');
  24. var bwstocLink = document.getElementById('bwstocLink');
  25. if (bwstocBtn.style.display === 'none') {
  26. bwstocBtn.style.display = 'block';
  27. bwstocWrapID.style.display = 'block';
  28. bwstocLink.innerHTML = 'إخفاء';
  29.  
  30. } else {
  31. bwstocBtn.style.display = 'none';
  32. bwstocWrapID.style.display = 'inline-block';
  33. bwstocLink.innerHTML = 'إظهار';
  34. }
  35. }
  36. //]]>
  37. </script>
  38. <noscript><style media='all' type='text/css'>#bwstocwrap,.bwstoc{display:none !important;visibility:hidden !important;width:0 !important;height:0 !important;}</style></noscript>
  39. </b:if>
Add Comment
Please, Sign In to add comment