jQuery dynamic loading contents
I have a problem with dynamic loading contents. I have the menu where after div clicking is hiding, they are loading new contents and he is moving.. it works correctly, however in new contents I have submenu, which would like to use the same effect for what for the menu, however is coming into existence the problem and the link cause the immediate passage 

What's is wrong in code ? 

     $(document).ready(function() {
    
        var hash = window.location.hash.substr(1);
        var href = $('.nav li a').each(function(){
            var href = $(this).attr('href');
            if(hash==href.substr(0,href.length-5)){
                var toLoad = hash+'.html #content';
                $('#content').load(toLoad)
            }                                           
        });
    
        $('.nav li a').click(function(){
    
            var toLoad = $(this).attr('href')+' #content';
            $('#content').hide('fast',loadContent);
            $('#load').remove();
            $('#wrapper').append('<span id="load">LOADING...</span>');
            $('#load').fadeIn('normal');
            window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
            function loadContent() {
                $('#content').load(toLoad,'',showNewContent())
            }
            function showNewContent() {
                $('#content').show('normal',hideLoader());
            }
            function hideLoader() {
                $('#load').fadeOut('normal');
            }
            return false;
    
        });
    
    });


jQuery dynamic loading contents
===

I have a problem with dynamic loading contents. I have the menu where after div clicking is hiding, they are loading new contents and he is moving.. it works correctly, however in new contents I have submenu, which would like to use the same effect for what for the menu, however is coming into existence the problem and the link cause the immediate passage 

What's is wrong in code ? 

     $(document).ready(function() {
    
        var hash = window.location.hash.substr(1);
        var href = $('.nav li a').each(function(){
            var href = $(this).attr('href');
            if(hash==href.substr(0,href.length-5)){
                var toLoad = hash+'.html #content';
                $('#content').load(toLoad)
            }                                           
        });
    
        $('.nav li a').click(function(){
    
            var toLoad = $(this).attr('href')+' #content';
            $('#content').hide('fast',loadContent);
            $('#load').remove();
            $('#wrapper').append('<span id="load">LOADING...</span>');
            $('#load').fadeIn('normal');
            window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
            function loadContent() {
                $('#content').load(toLoad,'',showNewContent())
            }
            function showNewContent() {
                $('#content').show('normal',hideLoader());
            }
            function hideLoader() {
                $('#load').fadeOut('normal');
            }
            return false;
    
        });
    
    });

