daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class calculator {
  2.         constructor(){
  3.           this.calcTitle = document.getElementsByClassName("calculator-title");
  4.           this.calcSection = document.getElementsByClassName("calculator-info");
  5.         }
  6.         hidetabcontect(){
  7.             for (var i = 0; i < this.calcTitle.length; i++) {
  8.               this.calcSection[i].style.display = "none";
  9.               this.calcTitle[i].classList.remove("active");
  10.             }
  11.         }
  12.         tabcalc(){
  13.             for (let i = 0; i < this.calcTitle.length; i++) {
  14.               this.calcTitle[i].addEventListener("click", (e) => {
  15.                    e.preventDefault();
  16.                    hidetabcontect();
  17.                    this.calcTitle[i].classList.add("active");
  18.                    $(`.calculator-info:eq(${i})`).fadeTo("slow", 1);
  19.                })
  20.             }
  21.         };
  22. }
  23. let calculatorOne = new calculator();
  24. calculatorOne.tabcalc();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top