What you need to do is modify the javascript to tell it you have extra initbox()
Here's how I did it for three links:
Code:
// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var bouncelimit=8 //(must be divisible by 8)
var direction="up"
function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-100+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}
function initbox2(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin2").style : ie? document.all.dropin2 : document.dropin2
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-100+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin2()",50)
}
function initbox3(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin3").style : ie? document.all.dropin3 : document.dropin3
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-100+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin3()",50)
}
function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}
function dropin2(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein2()",50)
}
}
function dropin3(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein3()",50)
}
}
function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}
function bouncein2(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}
function bouncein3(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}
function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}
function dismissbox2(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}
function dismissbox3(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}
function redo(){
bouncelimit=8
direction="up"
initbox()
}
function redo2(){
bouncelimit=8
direction="up"
initbox2()
}
function redo3(){
bouncelimit=8
direction="up"
initbox3()
}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
Then in your html you have:
HTML Code:
<a href="#" onmousedown="initbox()">click here</a>
<a href="#" onmousedown="initbox2()">click here for 2nd link</a>
<a href="#" onmousedown="initbox3()">click here for 3rd link</a>
And to close would be:
HTML Code:
<a href="#" onclick="dismissbox();return false">
<a href="#" onclick="dismissbox2();return false">
<a href="#" onclick="dismissbox3();return false">
Then just make sure your divs have the correct individual names to match.
Bookmarks