Advertisement
highrockmedia

Inline control structure

Aug 29th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // mobile menu
  2.   $('.nav-toggle').click(function () {
  3.     $('#main-menu div ul:first-child').slideToggle(250);
  4.       return false;
  5.   });
  6.   if (($(window).width() > 767) || ($(document).width() > 767)) {
  7.     $('#main-menu li').mouseenter(function () {
  8.       $(this).children('ul').css('display', 'none').stop(true, true).slideToggle(250).css('display', 'block')
  9.         .children('ul').css('display', 'none');
  10.     });
  11.     $('#main-menu li').mouseleave(function () {
  12.       $(this).children('ul').stop(true, true).fadeOut(250).css('display', 'block');
  13.     })
  14.   }
  15.   else {
  16.     $('#main-menu li').each(function () {
  17.       if ($(this).children('ul').length)
  18.         $(this).append('<span class="drop-down-toggle"><span class="drop-down-arrow"></span></span>');
  19.     });
  20.     $('.drop-down-toggle').click(function () {
  21.       $(this).parent().children('ul').slideToggle(250);
  22.     });
  23.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement