PDA

View Full Version : changes to the Multi-part content script



bahia
05-04-2006, 12:29 PM
Script: DD Multi-part content script
http://www.dynamicdrive.com/dynamicindex17/multipartcontent.htm

Hi!

Looked through the board but did not see this: How can I change the Multi-part content script so below I don't have a "forward" and "back" button but "content1", "content2", "content3" and so on?
Can anyone help?

Thanks,
Chris

Twey
05-04-2006, 02:50 PM
You daft fish.

bahia
05-04-2006, 05:06 PM
Sorry, here it is:
http://www.dynamicdrive.com/dynamicindex17/multipartcontent.htm

Chris

Twey
05-04-2006, 05:16 PM
Have a new function:
function cycleto(/*int*/ num){
partscollect[curpart].style.display="none"
curpart=num;
partscollect[curpart].style.display="block"
updatenav()
}
And edit updatenav():
function updatenav(){
document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
for(var i=0;document.getElementById("tobutton" + i);i++) document.getElementById("tobutton" + i).style.visibility == (i==curpart ? "hidden" : "visible");
}
Then:
<a href="javascript:cycleto(0);" id="tobutton0">Go to first part</a>
<a href="javascript:cycleto(1);" id="tobutton1">Go to second part</a>
<a href="javascript:cycleto(2);" id="tobutton2">Go to third part</a>
<!-- ... etc ... -->Wrap the forward and back buttons in <div style="display:none;"> if you don't want them.

bahia
05-07-2006, 09:23 PM
this is JUST GREAT!
Works perfect!
Thanks a lot, Twey!

Chris