lugarcia94

script.js

Sep 10th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.08 KB | None | 0 0
  1.    var slidebar_width  = jQuery(window).width(); //slidebar width + padding size
  2.    var slide_bar       = jQuery(".side-menu-wrapper"); //slidebar
  3.    var slide_open_btn  = jQuery(".slide-menu-open"); //slidebar close btn
  4.    var slide_close_btn = jQuery(".menu-close"); //slidebar close btn
  5.    var overlay         = jQuery(".side-menu-overlay"); //slidebar close btn
  6.  
  7.    slide_open_btn.click(function(e){
  8.        e.preventDefault();
  9.        slide_bar.css( {"left": "0px"}); //change to "right" for right positioned menu
  10.        overlay.css({"opacity":"1", "width":"100%"});
  11.    });
  12.  
  13.    slide_close_btn.click(function(e){
  14.        e.preventDefault();
  15.        slide_bar.css({"left": "-"+ slidebar_width + "px"}); //change to "right" for right positioned menu
  16.        overlay.css({"opacity":"0", "width":"0"});
  17.    });
  18.  
  19.    jQuery('.button__subcategories').on('click', function() {
  20.        if(!jQuery(this).parent().hasClass('on__submenu')) {
  21.            jQuery(this).parent().addClass('on__submenu');
  22.        } else {
  23.            jQuery(this).parent().removeClass('on__submenu');
  24.        }
  25.    });
Add Comment
Please, Sign In to add comment