Advertisement
valdeir2000

StackOverflow 270800

Jan 21st, 2018
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mobileItems = document.querySelector('#slide-out .nav-mobile .main-menu');
  2.  
  3. mobileItems.querySelector('li.menu-item-has-children')
  4.     .insertAdjacentHTML('beforeend', '<i class="mobile-arrows fa fa-chevron-down"></i>');
  5.    
  6. document.querySelector("li.menu-item-has-children i.mobile-arrows").addEventListener("click", el => {
  7.    
  8.     if (el.classList.contains("fa-chevron-down")) {
  9.         el.classList.remove('fa-chevron-down');
  10.         el.classList.add('fa-chevron-up');
  11.     } else {
  12.         el.classList.add('fa-chevron-down');
  13.         el.classList.remove('fa-chevron-up');
  14.     }
  15.    
  16.     el.parentNode.querySelectorAll('ul')[0].classList.toggle('hidden')
  17. })
  18.  
  19.  
  20. var mobileItems = document.querySelector( '#slide-out .st-nav-mobile .main-menu' );
  21. mobileItems.querySelector('div.penci-mega-latest-posts').remove();
  22. mobileItems.querySelector('div.mega-cat-content-tab').remove();
  23. mobileItems.querySelector('div.mega-recent-post').remove();
  24. mobileItems.querySelector('div.mega-recent-post').remove();
  25.  
  26. let elementTemp = mobileItems.querySelector('.mega-cat-wrapper');
  27. elementTemp.parentNode.replaceWith(elementTemp);
  28.  
  29. let elementTemp = mobileItems.querySelector('.mega-cat-sub-categories');
  30. elementTemp.parentNode.replaceWith(elementTemp);
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement