PDA

View Full Version : Drag and drop photos from drop down menu



swtgoddess
02-28-2006, 05:19 AM
I'm trying to get a drop menu that when selected shows a preview of a picture that can be dragged to another part of page. I have a script for a picture drop menu and one for drag and drop but i can't get them to work together. Can anyone tell me how to get them to work together or tell me where to find a script to do it. Thanx



drag and drop script from this site

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>





picture dropmenu script


script language=Javascript1.2> <!--
function previewImage()
{
tindex = document.f.colortheme.selectedIndex;
var previewImage = document.f.colortheme.options[tindex].value;
document.getElementById('PREVIEW').src = previewImage;
return false;</script>