Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var width = $(widow).width();
- alert(width);
- if((width <= 768 ){
- $('body').addClass('js');
- var $menu = $('#menu'),
- $menulink = $('.menu-link'),
- $menuTrigger = $('.has-submenu > a');
- $menulink.click(function(e) {
- e.preventDefault();
- $menulink.toggleClass('active');
- $menu.toggleClass('active');
- });
- $menuTrigger.click(function(e) {
- e.preventDefault();
- var $this = $(this);
- $this.toggleClass('active').next('ul').toggleClass('active');
- });
- }
- });
- $(document).ready(function(){
- var width = $(window).width();
- alert(width);
- if(width <= 768 ){
- $('body').addClass('js');
- var $menu = $('#menu'),
- $menulink = $('.menu-link'),
- $menuTrigger = $('.has-submenu > a');
- $menulink.on('click',function(e) {
- e.preventDefault();
- $menulink.toggleClass('active');
- $menu.toggleClass('active');
- });
- $menuTrigger.on('click',function(e) {
- e.preventDefault();
- var $this = $(this);
- $this.toggleClass('active').next('ul').toggleClass('active');
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement