PDA

View Full Version : using iframes within animatedcollapse script



remoteone
10-28-2012, 05:28 AM
1) Script Title: Problem when using iFrame that themselves contain JS.

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

3) Describe problem:
Refer to this test page:
http://wireless-broadband-speed.com.au/html/coverage_maps/coverage_maps_test.html

The script is modified with CSS and the content of the expanded box is an iFrame reference to a remote web page that also has Javascript.
The problem is evident when there is more than one <DIV> containing an iframe which contains similar JS content on the same page, and is not dependent upon the number of groups.

In this example only the first DIV that is set to "hide=0" loads ok. Any subsequent DIVS will not load the remote page assigned to the iframe, when expanded.

By not loading either of the </js/animatedcollapse.js> or <jquery.min.js"> files all the iframes contents work fine.

FF Error console shows errors only from the remote page contained in the iframe, no error seem to be coming from my page itself.

I really need this to work with iFrames that display remote pages that contain the js code used in the example.
I hope that all makes sense...

Help greatly appreciated.... see also https://www.odesk.com/o/jobs/job/_~013cf6afd8ade06cd5/

remoteone
11-07-2012, 12:37 AM
To fix this problem I think it will be necessary to load the <DIV> content in sequence, in order of priority.
I believe my problem is that the iframes are loading the remote content simultaneously,
Is there a way to have the DIV content load in a sequence dictated by the order of the animatedcollapse.addDiv .
The code mods need to be in the animatedcollapse.js file.

So, for example, if the html file the divs are defined like this:
animatedcollapse.addDiv('Box_A', 'fade=0,speed=400,group=group_1,hide=1')
animatedcollapse.addDiv('Box_B', 'fade=0,speed=400,group=group_1,hide=0')
animatedcollapse.addDiv('Box_C', 'fade=0,speed=400,group=group_2,hide=1')
animatedcollapse.addDiv('Box_D', 'fade=0,speed=400,group=group_2,hide=0')

The iFrames (the DIV content may actually not be an iFrame) should load in this order of priority, starting from the top line
1: Box_A, (the first box in list that is expanded; hide=0)
2: Box_C, (the next box in list that is expanded; hide=0)
3: Box_B, (the first box in list that is contracted; hide=1)
4: Box_D, (the next box in list that is contracted; hide=1)

Help greatly appreciated.
Joe

keyboard
11-07-2012, 01:08 AM
The link you provided doesn't work.
From the link at the bottom of your page, I'd say your looking for payed help.
If so, you should post in the DDscripts paid help forum.