SHARE
TWEET

Untitled

a guest Sep 12th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   script(type='text/javascript').
  2.     var Index = 1;
  3.     showtab(Index);
  4.     function tab(n) {
  5.     showtab(Index = n);
  6.     }
  7.     function showtab(n) {
  8.     var i;
  9.     var tabs = document.getElementsByClassName("tab");
  10.     var men = document.getElementsByClassName("men");
  11.     if (n > tabs.length) {Index = 1}
  12.     if (n < 1) {Index = tabs.length}
  13.     for (i = 0; i < tabs.length; i++) {
  14.     tabs[i].className = tabs[i].className.replace(" actv", "");
  15.     men[i].className = men[i].className.replace(" bg", "");
  16.     }
  17.     tabs[Index-1].className += " actv";
  18.     men[Index-1].className += " bg";
  19.     }
  20.   script.
  21.     var x, i, j, selElmnt, a, b, c;
  22.     x = document.getElementsByClassName("custom-select");
  23.     selElmnt = x[0].getElementsByTagName("select")[0];
  24.     a = document.createElement("DIV");
  25.     a.setAttribute("class", "select-selected");
  26.     a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;
  27.     x[0].appendChild(a);
  28.     b = document.createElement("DIV");
  29.     b.setAttribute("class", "select-items select-hide");
  30.     for (j = 1; j < selElmnt.length; j++) {
  31.     c = document.createElement("DIV");
  32.     c.innerHTML = selElmnt.options[j].innerHTML;
  33.     c.addEventListener("click", function(e) {
  34.     var y, i, k, s, h;
  35.     s = this.parentNode.parentNode.getElementsByTagName("select")[0];
  36.     cities = document.getElementById("city");
  37.     h = this.parentNode.previousSibling;
  38.     for (i = 0; i < s.length; i++) {
  39.     if (s.options[i].innerHTML == this.innerHTML) {
  40.     s.selectedIndex = i;
  41.     h.innerHTML = this.innerHTML;
  42.     y = this.parentNode.getElementsByClassName("same-as-selected");
  43.     for (k = 0; k < y.length; k++) {
  44.     y[k].removeAttribute("class");
  45.     }
  46.     this.setAttribute("class", "same-as-selected");
  47.     break;
  48.     }
  49.     }
  50.     h.click();
  51.     });
  52.     b.appendChild(c);
  53.     }
  54.     x[0].appendChild(b);
  55.     a.addEventListener("click", function(e) {
  56.     e.stopPropagation();
  57.     closeAllSelect(this);
  58.     this.nextSibling.classList.toggle("select-hide");
  59.     this.classList.toggle("select-arrow-active");
  60.     });
  61.     function closeAllSelect(elmnt) {
  62.     var x, y, i, arrNo = [];
  63.     x = document.getElementsByClassName("select-items");
  64.     y = document.getElementsByClassName("select-selected");
  65.     for (i = 0; i < y.length; i++) {
  66.     if (elmnt == y[i]) {
  67.     arrNo.push(i)
  68.     } else {
  69.     y[i].classList.remove("select-arrow-active");
  70.     }
  71.     }
  72.     for (i = 0; i < x.length; i++) {
  73.     if (arrNo.indexOf(i)) {
  74.     x[i].classList.add("select-hide");
  75.     }
  76.     }
  77.     }
  78.     document.addEventListener("click", closeAllSelect);
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