-
Problem with Tabs script and Collapsable DIV
Hello,
I'm trying to have a collapsable div work inside an ajax Tab Div.
http://www.dynamicdrive.com/dynamici...edcollapse.htm
http://www.dynamicdrive.com/dynamici...tent/index.htm
Everything works fine if the expandable/collapsable div is inside the default div (the one in the main page). But only as long as you don't change tabs, and load a different page inside the div. If you do and you go back to the original page it stops working.
I think the problem is with the location of this code:
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse2=new animatedcollapse("cat", 800, true)
</script>
But I couldn't find out how to solve it.
I've uploaded an example here:
http://www.arbel-designs.com/script_problem/demo.htm
Any help would be greatly appreciated.
Idan
-
-
The problem is the way the default/ non Ajax Tab's content is saved- as a "snapshot", using the .innerHTML property. This means when you click on a Ajax Tab and back to the default Tab, the script merely outputs the saved HTML of the Tab Content, with JavaScript inside no longer working.
The regular non Ajax Tab Content script works differently, and merely collapses the previous Tab Content when showing the new. This should mean any dynamic content within it should continue to work afterwards.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks