PDA

View Full Version : Have to refresh the page to work properly



tp4f
10-14-2007, 07:18 AM
1) Script Title: Animated Collapsible DIV

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

3) Describe problem: Its not urgent, but when I go to the plain url of my site (the problem url is: http://theplace4fun.parahosting.net/downloads.htm, and I go to the 'Games' tab, the Animated DIV won't work. But when I refresh the page, it works fine. Is that just my computer, or did i do something wrong:confused:?

Thankyou!!!

djr33
10-14-2007, 07:45 AM
Weird. The links seem to work-- but they point back to parts of this site.
I'm a bit confused.

The bottom links seem to work regardless of refreshing.

tp4f
10-14-2007, 07:48 AM
Weird. The links seem to work-- but they point back to parts of this site.
I'm a bit confused.

The bottom links seem to work regardless of refreshing.
Yes, the Tabs work fine. But its the sliding links in the Games tab that aren't working very well.

ddadmin
10-14-2007, 07:53 AM
Weird. The links seem to work-- but they point back to parts of this site.
I'm a bit confused..

There's an error in his link that caused a 404 page to load, which is what you're seeing I believe. Anyhow, I've fixed the link.

The problem is due to the fact that, when the page loads for the first time, the 1st tab content is the one that's visible while the others are hidden. Since the Animated Content script is in one of those DIVs that are hidden, when it tries to calculate the height of the elements it is supposed to expand/contract, it returns a 0 height, hence the appearance it's not working. When you reload the page, due to persistence, the DIV containing the Animated Content script is the one shown by default, which in turn returns the proper height values for the elements the script is animating.

There are probably ways around this, but it would be a lot easier just to not use this script within any of your Tab Content DIVs, since it's not a critical point either way, just a visual touch...

djr33
10-14-2007, 08:06 AM
No, I fixed the link, but maybe in doing so, I already did one load, however that was affecting the script.