manitoon
09-28-2005, 07:22 AM
DHTML Window
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow.htm
I am trying to modify this script a little
My issue was that I had to be able to open multiple dhtml windows in a same broswer.
I was successfull to some extent. By i cant move the windows now.
the problem is here
function drag_drop(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"
}
Now What i want to do is when i call this function i pass the name of the window which need to be moved. right ?
So I need to pass the value of dwindow when i call this function
Thisfunction is called by the line below
document.getElementById(dwindow).onmousemove= drag_drop
I thought If i modify the above line
like
document.getElementById(dwindow).onmousemove= drag_drop(e,dwindow)
it would pass the name of window and it does
the function would be
function drag_drop(e,dwindow){
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"
}
But when I do this . the values is passed but I get this error
NOT IMPLEMENTED ..
and the moving of window doesnt work.
I hope I have made myself clear :)
I need help here
Thanks
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow.htm
I am trying to modify this script a little
My issue was that I had to be able to open multiple dhtml windows in a same broswer.
I was successfull to some extent. By i cant move the windows now.
the problem is here
function drag_drop(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"
}
Now What i want to do is when i call this function i pass the name of the window which need to be moved. right ?
So I need to pass the value of dwindow when i call this function
Thisfunction is called by the line below
document.getElementById(dwindow).onmousemove= drag_drop
I thought If i modify the above line
like
document.getElementById(dwindow).onmousemove= drag_drop(e,dwindow)
it would pass the name of window and it does
the function would be
function drag_drop(e,dwindow){
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"
}
But when I do this . the values is passed but I get this error
NOT IMPLEMENTED ..
and the moving of window doesnt work.
I hope I have made myself clear :)
I need help here
Thanks