Sure, the code I gave above is just an example of how the idea would work. Below is a more generic version:
Code:
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse7=new animatedcollapse("cat", 800, false)
var param=window.location.href.match(/expand=(\d+)/i)
var paramvalue=RegExp.$1
if (/\d+/i.test(paramvalue)) //if URL parameter contains "?expand=integer"
animatedcollapse.dotask(window, function(){setTimeout("window['collapse'+paramvalue].slidedown()", 200)}, "load")
</script>
This lets you have a URL like:
Code:
target.htm?expand=INTEGER
In which collapseINTEGER.slidedown() would be called on the target page.
Right where the code is now is fine, as it doesn't really matter, since the final code will be called after the page has loaded, regardless of where you put it on the page.
Bookmarks