View Full Version : Ajax Animated Collapsible IE

01-24-2011, 04:50 PM
1) Script Title: Animated Collapsible DIV v2.4

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: I am trying to dynaimcally load via ajax, links with divs and each time an additional link and div are added to the page them also have the animated collapse capability. In Firefox and Chrome I have no issues but in IE8 it all goes wrong and only the most recently added div is collapsible. When ajax reads a successfull return I add the responseText to the end of the target div's innerHTML, add the id of the div to the end of an array then loop through this array with




//then finally

animatedcollapse.ontoggle=function($, divobj, state){}

I found an uninit() method and tried using that onload of a new div but that is also not working.

If I build out an array in JS var ar = newArray('1','2','3','4'); then add all 4 divs in one ajax call then loop



all 4 divs work fine, but if i try and add individual divs after the first call to
animatedcollapse.ontoggle=function($, divobj, state){};

only the last one added works