View Full Version : Delay between page load and sub-menu content's display
bfider2k
04-04-2008, 04:30 PM
1) Script Title: DD Tab Menu
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
3) Describe problem: When the page loads, there is a slight delay before the sub-menu's content is displayed. Is there a way to avoid that?
ddadmin
04-04-2008, 08:09 PM
That's because the menu is initialized after the document has loaded. You can avoid that delay by first moving the initialization code within your HTML from the HEAD to the very bottom of the page, ie:
<script type="text/javascript">
//SYNTAX: ddtabmenu.definemenu("tab_menu_id", integer OR "auto")
ddtabmenu.definemenu("ddtabs1", 0) //initialize Tab Menu with ID "ddtabs1" and select 1st tab by default
</script>
</body>
Then, inside the js file, change:
this.addEvent(window, function(){ddtabmenu.init(tabid, dselected)}, "load")
to just:
ddtabmenu.init(tabid, dselected)
bfider2k
04-07-2008, 02:47 AM
hey that works great, thank you.
is there any risk involved in doing this?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.