Guest User

sodentoc

a guest
Aug 6th, 2021
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.61 KB | None | 0 0
  1. <b:if cond='data:blog.pageType == "item" or data:blog.pageType == "static_page"'>
  2. <style media='all' type='text/css'>
  3. /*
  4.  * Blogspot TOC
  5.  * https://bibit.ws/toc-di-blogspot.php
  6. */
  7. .bwstoc {
  8.  margin: 10px 0;
  9.  background: #F0F0F0;
  10.  border: 1px solid #ddd;
  11. }
  12. .bwstoc ol, .bwstoc ul {
  13.  margin: 0 0 15px 20px;
  14.  padding: 0;
  15. }
  16. .bwstoc ul {
  17.  list-style: disc;
  18. }
  19. .bwstoc ol li, .bwstoc ul li {
  20.  font-size: 95%;
  21.  padding: 5px 10px 0 0;
  22.  margin: 0 0 0 30px;
  23. }
  24. .bwstoc a {
  25.  text-decoration: none;
  26. }
  27. .bwstoc a:hover {
  28.  text-decoration: underline;
  29. }
  30. .bwstoc .bwstocHeader {
  31.  font-weight: bold;
  32.  font-size: 100%;
  33.  position: relative;
  34.  outline: none;
  35.  border: none;
  36.  padding: 5px 15px 5px 5px;
  37.  margin: 5px 10px;
  38. }
  39. .bwstoc .bwstocHeader a {
  40.  text-decoration: none;
  41.  cursor: pointer;
  42. }
  43. .bwstoc .bwstocHeader a:hover {
  44.  text-decoration: underline;
  45. }
  46. </style>
  47. <!-- Blogger TOC -->
  48. <script type='text/javascript'>
  49. /*
  50.  * SEO Friendly Blogspot Table Of Contents
  51.  * https://bibit.ws/toc-di-blogspot.php
  52. */
  53. //<![CDATA[
  54. function bwstoc() {
  55.  var bwstoc = i = headinglength = getheading = 0;
  56.  headinglength = document.getElementById("post-toc").querySelectorAll("h2, h3, h4").length;
  57.  if (headinglength > 1) {
  58.  // Hanya Tampil Jika Ditemukan Minimal 2 Heading
  59.  for (i = 0; i < headinglength; i++) {
  60.  getheading = document.getElementById("post-toc").querySelectorAll("h2, h3, h4")[i].textContent;
  61.  var bws_1 = getheading.replace(/[^a-z0-9]/gi," ");
  62.  var bws_2 = bws_1.trim();
  63.  var getHeadUri = bws_2.replace(/\s/g, "_");
  64.  document.getElementById("post-toc").querySelectorAll("h2, h3, h4")[i].setAttribute("id", getHeadUri);
  65.  bwstoc = "<li><a href='#" + getHeadUri + "'>" + getheading + "</a></li>";
  66.  document.getElementById("bwstoc").innerHTML += bwstoc;
  67.  }
  68.  } else { document.write("<style>.bwstoc{display:none !important;visibility:hidden !important;width:0 !important;height:0 !important;}</style>"); }
  69. }
  70. function bwstocShow() {
  71.     var bwstocBtn = document.getElementById('bwstoc');
  72.  var bwstocWrapID = document.getElementById('bwstocwrap');
  73.  var bwstocLink = document.getElementById('bwstocLink');
  74.     if (bwstocBtn.style.display === 'none') {
  75.         bwstocBtn.style.display = 'block';
  76.  bwstocWrapID.style.display = 'block';
  77.  bwstocLink.innerHTML = 'Tutup';
  78.  
  79.     } else {
  80.         bwstocBtn.style.display = 'none';
  81.  bwstocWrapID.style.display = 'inline-block';
  82.  bwstocLink.innerHTML = 'Tampil';
  83.     }
  84. }
  85. //]]>
  86. </script>
  87. <noscript><style media='all' type='text/css'>#bwstocwrap,.bwstoc{display:none !important;visibility:hidden !important;width:0 !important;height:0 !important;}</style></noscript>
  88. </b:if>
Advertisement
Add Comment
Please, Sign In to add comment