1) Script Title: Animated Collapsible DIV v2.01
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...edcollapse.htm
3) Describe problem:
First of all thanks for the script, the animation is just what I've been looking for.
The script works quite fine if a website is loaded completely, but I included in in a web-application to show a status-window of background-tests, which run for quite a while.The main site keeps loading until all tests have been finished.
During the website is not loaded completely, the script doesn't work. I tried to debug the problem as good as I could.
The addDiv:function is getting loaded and divid is present within the function. Also within showhide:function the divid is present, but all variables of this.divholders[divid].$divref are missing (null). As already mentioned, the script works after the load of the site is aborted or finished, so it seems to me, that this.divholders[divid].$divref is only available after a the website is loaded completely.
Since I did not get more information on the web about this.divholders[divid].$divref, I hope someone here is able to explain this behavior.
The following code snippet shows the problem quite good I guess (copied together from my source, since the app is not public. sleep() of cource is a substitute for the running tests).
Click the show/hide during sleep and nothing hapens. Wait sleep to be finished or abort the loading and it works.
Thanks in advancePHP Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>poc</title>
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js"></script>
<script type="text/javascript">
animatedcollapse.addDiv('test')
animatedcollapse.init()
</script>
</head>
<body>
<a href="javascript:animatedcollapse.toggle('test')">show/hide Status</a>
<div id="test" style="width: 400px; background: #FFFFFF; display:none">
<iframe src="somesite.html" height="100" width="400" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>
</div>
<?php @flush(); @ob_flush(); sleep(60); ?>
</body>
</html>
tobsen02



Reply With Quote

Bookmarks