AngeLofPeAcE
04-01-2003, 08:13 PM
hi... i used the drag and drop code from some site and it worked but some of the lings i want to go on top of each other...just go under it. if you know what i mean. here is the code im using.
first this in one place:
<style>
<!--
.drag{position:relative;cursor:hand}
-->
</style>
<script language="JavaScript1.2">
<!--
/*
Drag and Drop Script-
? Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var dragapproved=false
var z,x,y
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}
}
function drags(){
if (!document.all)
return
if (event.srcElement.className=="drag"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
temp2=z.style.pixelTop
x=event.clientX
y=event.clientY
document.onmousemove=move
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")
//-->
</script>
THEN THIS IN ANOTHER
<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<img src="GREENPOSTERBACK.gif" class="drag"><br>
</body>
</html>
AND THIS NEXT TO IT
<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<img src="pencil.gif" class="drag"><br>
</body>
</html>
SO WHEN I WANT THE PENCIL IMAGE TO GO OVER THE POSTERBACK IMAGE....IT GOES UNDER IT. HOW DO I FIX THAT??? PLEASE HELP. THANKS
first this in one place:
<style>
<!--
.drag{position:relative;cursor:hand}
-->
</style>
<script language="JavaScript1.2">
<!--
/*
Drag and Drop Script-
? Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var dragapproved=false
var z,x,y
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}
}
function drags(){
if (!document.all)
return
if (event.srcElement.className=="drag"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
temp2=z.style.pixelTop
x=event.clientX
y=event.clientY
document.onmousemove=move
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")
//-->
</script>
THEN THIS IN ANOTHER
<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<img src="GREENPOSTERBACK.gif" class="drag"><br>
</body>
</html>
AND THIS NEXT TO IT
<html>
<head>
<!--drag engine code installed here-->
</head>
<body>
<img src="pencil.gif" class="drag"><br>
</body>
</html>
SO WHEN I WANT THE PENCIL IMAGE TO GO OVER THE POSTERBACK IMAGE....IT GOES UNDER IT. HOW DO I FIX THAT??? PLEASE HELP. THANKS