0

So I tried to use code posted here somewhere (by users/1022305/trevor) but can't make it work in browser.

Here is the fiddle by the author of the code: http://jsfiddle.net/trevordowdle/S7n2b/

Tried to wrap jquery code like this:

var stop = true;
var hovered;
var timeout;


$(document).ready(function(){
    $('.nav').hover(
        function(){
            clearTimeout(timeout);
            stop = true;
            hovered = this;
            timeout = setTimeout(function(){
            if($(hovered).hasClass('nav_menu_link_drop')){
                $('.content').css('z-index',0);
                $(hovered).next('.content').css('z-index',5);        
                $(hovered).next('.content').slideDown(350);
                timeout = setTimeout(function(){
                    $('.content').not($(hovered).next('.content')).slideUp(350);  
                },200);
            }
            else
                $('.content').slideUp(350);    
            },400);
        },
        function(e){
            stop = false;
            clearTimeout(timeout);
            setTimeout(function(){
                if(!stop)
                    $('.content').slideUp(350);
            },500);
        }
    );
});

$(document).ready(function(){
    $('.content').hover(
        function(){
            stop = true;    
        },
        function(){

        }
    );
});

$(document).ready(function(){
    $('#nav_menu').hover(
        function(){

        },
        function(){
            timeout = setTimeout(function(){
                $('.content').slideUp(350);
            },200);
        }
    );
});

So above is an example with "$(document).ready(function(){", also tried wrapping with "$(window).load(function() {" and "$(function() {" - will not work.

There is no drop down effect at all.

Any suggestions?

Wuu
  • 81
  • 6

0 Answers0