SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Accordion Problems

    Hi, I've got an accordion style menu system. It's all working fairly well, except that when the page loads all of the sub-menus that should only be visible when the parent link is clicked on appear, then disappear a few seconds later.

    You can see an example of this here:

    http://www.stickyeyes.com/clients/spin-menu/menu.htm

    This may not be totally clear here as this is a stripped-down version of the page - the effect is much more pronounced when it has the rest of the page and all of its images, sIFR etc to load.

    Any ideas?

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StickyJonny View Post
    Hi, I've got an accordion style menu system. It's all working fairly well, except that when the page loads all of the sub-menus that should only be visible when the parent link is clicked on appear, then disappear a few seconds later.
    They have to be rendered that way initially in case JS isn't enabled. To make them close as soon as they are rendered, I would call the appInit function immediately after the rendering of the menu elements, instead of using the onload event.

    Remove the function call from the head section, and insert this just after the menu HTML:
    Code:
    <!-End of menu HTML-->
    <script type="text/javascript">
    defaultOpenTab = 1;
    
    function appInit() {
    	spinAccord = new spinAccordion( "DIV.stretchtoggle", "DIV.stretcher", defaultOpenTab);
    }
    appInit();
    </script>
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi - thanks Logic Ali. This doesn't seem to make too much of a difference unfortunately; any other ideas?

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StickyJonny View Post
    Hi - thanks Logic Ali. This doesn't seem to make too much of a difference unfortunately; any other ideas?
    Not without a URL...
    Tab-indentation is a crime against humanity.


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
  •