spyder
05-11-2007, 12:11 AM
i am using this code so that when i click on a dragable element, it comes to the top. how could i change it so that when i click on an object, a different object comes to the top. basicall i want to be able to hit a picture which will make a table appear.
<script language="Javascript">
<!--
last_z=""
function which_z(n){
document.getElementById(n).style.zIndex=6
if(last_z==""){
last_z=n
}
else{
document.getElementById(last_z).style.zIndex=""
}
last_z=n
}
// -->
</script>
onmouseup="which_z(this.id)"
<script language="Javascript">
<!--
last_z=""
function which_z(n){
document.getElementById(n).style.zIndex=6
if(last_z==""){
last_z=n
}
else{
document.getElementById(last_z).style.zIndex=""
}
last_z=n
}
// -->
</script>
onmouseup="which_z(this.id)"