The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Accordion Widget opening temporarily on page load

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #29300


    I have a couple of issues with the jQuery Accordion Widget. Firstly, like many other Accordion style scripts, it opens (shows the text content of) all sections with text in when the page loads. I am wondering why it does this and whether it is possible to prevent this as it spoils the effect of the accordion.

    Also, with the sections with text in I am getting a juddering in the opening of the accordion/resizing of the page, and wonder how I can prevent this.

    You can see what I mean here:

    I would be grateful for any advice



    Rob MacKay

    it is because the jQuery has to ADD the:

    style=”display: none; “

    to the UL after it has loaded. If you can add it to the accordion code, so the jQuery does not need to, then your issue will be solved.


    Thanks Rob

    That did the trick. I wonder if you also have an idea as to what is happening with sections 2 and 3, i.e. these sections slide down but then ‘jump’ at the end. This doesn’t happen with the first section that contains an image.

    My final question is whether there is a way of setting the speed of the slider to be a function of the height of the content, meaning that the actual speed of the effect will be the same, but it will take longer on slides with greater content/height. I am aware that I can set different speeds for the different sections in the widget.js, but as the content of the slides will be changing from time to time it would be good to not have to manually change the speed in order to keep a uniform speed across the accordion.


Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.