PDA

View Full Version : Enhancement for Switch Content Script II



robertjoy
06-11-2008, 03:57 PM
I added the following code to the switchcontent.js file. It allows the user to pass in a variable containing a comma separated list of indices to be expanded.



switchcontent.prototype.expandList=function(){ //PUBLIC: Expand contents method. (Values: list of indices)
if (typeof this.headers!="undefined" && this.headers.length>0){ //if there are switch contents defined on the page
list = arguments[0].split(",")
for (var i=0; i<list.length; i++){
this.expandcontent(this.headers[list[i]]) //expand each content
}
}
}


I think it's a nice addition to the script!

Robert Joy