This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

methods.js

By: a guest on Jul 9th, 2013  |  syntax: JavaScript  |  size: 1.41 KB  |  views: 148  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. });
clone this paste RAW Paste Data