Scriptaculous Toggle effect performance in IE

Posted on 2007-08-08
Last Modified: 2008-01-09

I'm using the scriptaculous toggle effect and it seems to hesitate for a few seconds when I first click on a link only in IE. After I click it once every level to click is fine. In Mozilla it loads just fine. Page loads and I select the first category and wa la it pops down instantly. Please let me know what I can do to solve this issue with IE.


Question by:brihol44
    LVL 75

    Assisted Solution

    by:Michel Plungjan
    Show your code, please
    LVL 3

    Assisted Solution

    Check your javascript console , you got any errors before u click on the toogle link...

    if still the error comes , plz specify on which style u face a problem ..(Slide , Blind or appear ) and post your
    LVL 16

    Accepted Solution

    IE doesn't have a JavaScript console as such, and if there are errors it would be more likely to fail completely rather than be slow.

    IE's DOM Collections are rather slow, for example, querying the length of a collection like this:
      var children = element.childNodes;
      for(var i = 0; i < children.length; i++)

    ... is very bad for performance in IE.  This is significantly faster:
      var children = element.childNodes;
      var childrenLength = children.length;
      for(var i = 0; i < childrenLength; i++)

    This is because a DOM Collection is "live" - even when returned from document.getElementsByTagName(...).  Every time you query the length it is recalculated in case there have been any changes to the DOM.


    Author Comment

    Hello LeeKowalkowski,

    So would I change this code in the scriptaculous files? Possibly the prototype.js file? or somewhere else?


    LVL 16

    Expert Comment

    I wouldn't know if you didn't show us your code.


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now