Results 1 to 3 of 3

Thread: Delay between page load and sub-menu content's display

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Delay between page load and sub-menu content's display

    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?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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:

    Code:
    this.addEvent(window, function(){ddtabmenu.init(tabid, dselected)}, "load")
    to just:

    Code:
    ddtabmenu.init(tabid, dselected)

  3. #3
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey that works great, thank you.

    is there any risk involved in doing this?

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
  •