View Full Version : Help Please


nanana
06-21-2005, 06:39 PM
i'm making this page with a drag and drop code. Everything's going fine except that i need to know how to decide which images go ontop and which go under. :cloud:

for example if i have two images images "X" and "Y" and i drag image "Y" onto image "X" how do i choose which one will go under and which one will stay on top? i hope i'm making sense.

all help is really appreaciated!

pb&j
06-21-2005, 08:19 PM
that really depends on the program you are using.
on some programs, you might be able to right click on the image and set its properties to back or forward or it may be labelled as z-index.

if you were doing your own coding (which is what this forum and tutorial site is all about) then we might be able to help you fix the codes you are currently using.

nanana
06-21-2005, 08:36 PM
ok well, i'm using www.piczo.com to host my webbie. This is the code I have in, plz tell me which areas to edit.

<STYLE>
img.drag {filter:chroma(color=#ffffff)}
.drag {
CURSOR: hand; POSITION: relative
}
</STYLE>

<script language=JavaScript1.2>
<!--

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><img class="drag" src="IMAGE URL HERE" style="z-index: 9999;"><img class="drag" src="IMAGE URL HERE" "z-index: 9998;">

but that doesn't work, what am I doing wrong?