1) CODE TITLE: Collapsable Div with limit and groups
2) AUTHOR NAME/NOTES: Master script maker (based on my other div script)
1. First download div.js and add this to the head of your code:2. For Groups:Code:<script type="text/javascript" src="div.js"></script>
a. Add this in your body:
and change the "limit1" and "limit2" to whatever you want to call them. You can have more then just the 2.Code:<script type="text/javascript"> var limit1 = new limit(# of divs allowed open at a time in group 1); var limit2 = new limit(# of divs allowed open at a time in group 2); <script>
b. If you want to open a div in group 1 use:
for group two, ect. just change the first part of the onclick. (limit1)HTML Code:<a href="#" onClick="limit1.change(div id)"></a>
You MUST have the ".change()" after the name of the limit.
3. For just the whole document:
a.b. If you want to open a div use:Code:<script type="text/javascript"> var limit = new limit(# of divs allowed open at a time); </script>
You can change the "limit" to whatever you want.HTML Code:<a href="#" onClick="limit.change(div id)"></a>
You MUST have the ".change()" after the name of the limit.
4) DESCRIPTION: A simple script that manages multiple groups of divs with independant limits(or just whole page). When a user tries to open more divs then the limit, the first div opened, is closed.
4) URL TO CODE:
Demo:http://masterproject.freehostia.com/div/divs.html
Script:http://masterproject.freehostia.com/div/div.js
or, ATTACHED BELOW (see #3 in guidelines below):



Reply With Quote

Bookmarks