pastebin - collaborative debugging tool
kpaste.net RSS


js
Posted by Anonymous on Wed 18th Nov 2020 21:50
raw | new post

  1. function toggleBtnClickEvHandler(event){
  2.     var evTarget = event.target;
  3.     var toggleBtn;
  4.     if(evTarget.parentElement.classList.contains("header-bottom-toggler")){
  5.         toggleBtn = evTarget.parentElement;
  6.     }
  7.     else if(evTarget.classList.contains("header-bottom-toggler")){
  8.         toggleBtn = evTarget;
  9.     }
  10.    
  11.     if(toggleBtn){
  12.         var headerBottomBtnsContainerEl = document.querySelector(".header-bottom-btns-container");
  13.         if(headerBottomBtnsContainerEl){
  14.             headerBottomBtnsContainerEl.classList.toggle("toggle-on");
  15.             toggleBtn.classList.toggle("toggle-on");
  16.         }
  17.     }
  18. }
  19.  
  20. document.addEventListener("DOMContentLoaded", function(){
  21.   document.addEventListener("click", toggleBtnClickEvHandler)
  22. })

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at