Results 1 to 3 of 3

Thread: Force loading of the Smooth Navigational Menu?

  1. #1
    Join Date
    Dec 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Force loading of the Smooth Navigational Menu?

    1) Script Title: Smooth Navigational Menu

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm

    3) Describe problem: I have a wibiya toolbar on my site and I notice that should the toolbar be slow to load then the Smooth Nav Menu won't either. It only loads after the toolbar does. Is there a way to make sure the menu loads regardless of the condition of the toolbar?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you place this sort of thing:

    Code:
    <script type="text/javascript">
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu1", //menu DIV id
    	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu', //class added to menu's outer DIV
    	//customtheme: ["#1c5a80", "#18374a"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu2", //Menu DIV id
    	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
    	//customtheme: ["#804000", "#482400"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    </script>
    as the very last thing before your closing </body> tag, you should be able to edit the ddsmoothmenu.js file here (near the end):

    Code:
    init:function(setting){
    	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
    		var mainmenuid='#'+setting.mainmenuid
    		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
    		document.write('<style type="text/css">\n'
    			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
    			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
    		+'</style>')
    	}
    	this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
    	jQuery(document).ready(function($){ //ajax menu?
    		if (typeof setting.contentsource=="object"){ //if external ajax menu
    			ddsmoothmenu.getajaxmenu($, setting)
    		}
    		else{ //else if markup menu
    			ddsmoothmenu.buildmenu($, setting)
    		}
    	})
    }
    
    } //end ddsmoothmenu variable
    to:

    Code:
    init:function(setting){
    	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
    		var mainmenuid='#'+setting.mainmenuid
    		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
    		document.write('<style type="text/css">\n'
    			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
    			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
    		+'</style>')
    	}
    	this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
    	;(function($){ //ajax menu?
    		if (typeof setting.contentsource=="object"){ //if external ajax menu
    			ddsmoothmenu.getajaxmenu($, setting)
    		}
    		else{ //else if markup menu
    			ddsmoothmenu.buildmenu($, setting)
    		}
    	})(jQuery);
    }
    
    } //end ddsmoothmenu variable
    This might do what you want. If not, I would probably need a link to your page:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that code. I also asked for info at wibiya and they told me to alter a switch in my control panel with them that has helped a lot. Haven't used your code yet but if there is a recurrence of the problem I will try it then.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •