Advertisement
Guest User

methods.js

a guest
Jul 9th, 2013
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var $j = jQuery.noConflict();
  2. $j(document).ready(function(){
  3.    
  4.     /* Reponsive videos */
  5.     $j(".content-right").fitVids();
  6.    
  7.     /* Reponsive menus */
  8.     $j(".nav").mobileMenu();
  9.    
  10.        /* Drop down menus */
  11.  
  12.    
  13.         $j(".inside-primary-nav ul li ul").parent().addClass("arrow");
  14.  
  15.     var hoverTimeout = null;
  16.     $j(".inside-primary-nav ul li").unbind();
  17.     $j(".inside-primary-nav ul li").hover(function(){
  18.         $j(this).siblings().each(function(){
  19.             $j(this).removeClass('hover').find('.sub-menu').hide();
  20.             $j(this).find('.hover').removeClass('hover');
  21.         });
  22.         $j(this).addClass("hover");
  23.         //Make sure parent style is ready to show new sub-menu
  24.         $j(this).closest('.sub-menu').css('overflow','visible');
  25.         $j(this).find(".sub-menu:first").stop().slideDown("fast");
  26.    }, function(){
  27.        if($j(this).find('.sub-menu:visible').length  === 0)
  28.            $j(this).removeClass("hover");
  29.    });
  30.  
  31.    $j(".inside-primary-nav > ul > li").hover(function(){
  32.        if(hoverTimeout){
  33.            clearTimeout(hoverTimeout);
  34.        }
  35.    },function(){
  36.        if($j(this).find('.sub-menu:visible').length > 0){
  37.            var that = $j(this);
  38.            hoverTimeout= setTimeout(function() {
  39.                that.removeClass('hover').find('.sub-menu').hide();
  40.                that.find('.hover').removeClass('hover');
  41.            }, 1000);
  42.        }
  43.    });
  44. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement