natesneat2000
Technical User
am selling a DVD of our graduation (b/c our school isn't selling tapes or anything), and am making an HTML menu with MenuBox for the DVD-ROM content. It'll basically be a pretty background with a bunch of layers, containing all the content, which can be dragged around.
I'm using this draggable layers script:
To support multiple layers, I replaced "dwindow" and the other calls with variables (like dwindow). My problem is, when initializeDrag calls drag_drop, drag_drop only gets contents of variable e, not dwindow. I'm not a master at JavaScript; please point me in the right direction.
<HEAD> Code Snippet
code:function drag_drop(e){
//alert(e)
//alert(dwindow)
//document.write(dwindow,e)
if (ie5&&dragapproved&&event.button==1){
document.getElementById(dwindow).style.left=tempx+event.clientX-offsetx+"px"
document.getElementById(dwindow).style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById(dwindow).style.left=tempx+e.clientX-offsetx+"px"
document.getElementById(dwindow).style.top=tempy+e.clientY-offsety+"px"
}
}
function initializedrag(e,dwindow,dwindowcontent){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById(dwindowcontent).style.display="none" //extra
tempx=parseInt(document.getElementById(dwindow).style.left)
tempy=parseInt(document.getElementById(dwindow).style.top)
dragapproved=true
document.getElementById(dwindow).onmousemove=drag_drop
I'm using this draggable layers script:
To support multiple layers, I replaced "dwindow" and the other calls with variables (like dwindow). My problem is, when initializeDrag calls drag_drop, drag_drop only gets contents of variable e, not dwindow. I'm not a master at JavaScript; please point me in the right direction.
<HEAD> Code Snippet
code:function drag_drop(e){
//alert(e)
//alert(dwindow)
//document.write(dwindow,e)
if (ie5&&dragapproved&&event.button==1){
document.getElementById(dwindow).style.left=tempx+event.clientX-offsetx+"px"
document.getElementById(dwindow).style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById(dwindow).style.left=tempx+e.clientX-offsetx+"px"
document.getElementById(dwindow).style.top=tempy+e.clientY-offsety+"px"
}
}
function initializedrag(e,dwindow,dwindowcontent){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById(dwindowcontent).style.display="none" //extra
tempx=parseInt(document.getElementById(dwindow).style.left)
tempy=parseInt(document.getElementById(dwindow).style.top)
dragapproved=true
document.getElementById(dwindow).onmousemove=drag_drop