had no clue where on here to put this, but i need help with this drag script, i have tried all but can't figure out how to make my pics draggable. can someone help me, only the test marks are draggable so far and that wont help..lol here is the script, please tell me where and how to add my pics like where the pic name should go in the script and should i rename the pic too? <style>
<!--
.drag {position: relative; cursor: hand;}
-->
</style>
<script language="JavaScript1.2">
<!--
//Generic Drag Script- © Dynamic Drive (
www.dynamicdrive.com)
//For full source code and terms of usage,
//visit
http://www.dynamicdrive.com
var ie=document.all
var ns6=document.getElementById&&!document.all
var dragapproved=false
var z,x,y
function move(e){
if (dragapproved){
z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
return false
}
}
function drags(e){
if (!ie&&!ns6)
return
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"
while (firedobj.tagName!=topelement&&firedobj.className! ="drag"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}
if (firedobj.className=="drag"){
dragapproved=true
z=firedobj
temp1=parseInt(z.style.left+0)
temp2=parseInt(z.style.top+0)
x=ns6? e.clientX: event.clientX
y=ns6? e.clientY: event.clientY
document.onmousemove=move
return false
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")
//-->
</script>
and this came with it to, but can't figure out here where the pic goes..lol Drag Layers
Instructions: It's cool. Check it out. All you have to do to make a layer or object draggable is to add the class 'drag' to almost any item in your page. Look at this example:
<img src="http://www.here.com/righthere.gif" class="drag">
or
<div class="drag"> This is in the draggable layer</div>
See how easy it is?