tomassantos
09-05-2008, 20:58
Olá, tive a desenvolver este código
<ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF"></ilayer><a href="google.pt" onMouseover="showit(1)"><font color="#000000">Tomás</font></a>
<p> </p>
<p> </p>
<p> </p>
<p><a href="google.pt" onMouseover="showit(0)">
<font color="#000000">Tomás2</font></a><ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF"></p>
<layer name="dep2" width=400 height=32>
</layer>
</ilayer>
<div id="describe" style="background-color:#E6E6FF;width:192px;height:189px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>
<script language="JavaScript1.2">
var submenu=new Array()
submenu[1]='<a href="google.comt" onMouseover="showit(0)"><font color="#000000">1</font></a> <p> <a href="google.com" onMouseover="showit(0)"><font color="#000000">2</font></a> <p> <a href="google.com"><font color="#000000">3</font></a> <p> <a href="google.com"><font color="#000000">4</font>'
submenu[0]='<a href="google.com" onMouseover="showit(0)"><font color="#000000">5</font></a> <p> <a href="google.com" onMouseover="showit(0)"><font color="#000000">6</font></a> <p> <a href="google.com"><font color="#000000">7</font></a> <p> <a href="google.com"><font color="#000000">8</font>'
var delay_hide=700
var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}
function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
</script>
Aqui está: http://tomassantos.do.sapo.pt/botoes.htm
Mas queria que aquela janela que aparece esteja: A do 'Tomas' por baixo desta e a do 'Tomás2' em baixo desta'
Não percebi como isso se faz, pois estou a começar a trabalhar com linguagens
Podiam-me dizer o código?
Obrigado.
<ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF"></ilayer><a href="google.pt" onMouseover="showit(1)"><font color="#000000">Tomás</font></a>
<p> </p>
<p> </p>
<p> </p>
<p><a href="google.pt" onMouseover="showit(0)">
<font color="#000000">Tomás2</font></a><ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF"></p>
<layer name="dep2" width=400 height=32>
</layer>
</ilayer>
<div id="describe" style="background-color:#E6E6FF;width:192px;height:189px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>
<script language="JavaScript1.2">
var submenu=new Array()
submenu[1]='<a href="google.comt" onMouseover="showit(0)"><font color="#000000">1</font></a> <p> <a href="google.com" onMouseover="showit(0)"><font color="#000000">2</font></a> <p> <a href="google.com"><font color="#000000">3</font></a> <p> <a href="google.com"><font color="#000000">4</font>'
submenu[0]='<a href="google.com" onMouseover="showit(0)"><font color="#000000">5</font></a> <p> <a href="google.com" onMouseover="showit(0)"><font color="#000000">6</font></a> <p> <a href="google.com"><font color="#000000">7</font></a> <p> <a href="google.com"><font color="#000000">8</font>'
var delay_hide=700
var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}
function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
</script>
Aqui está: http://tomassantos.do.sapo.pt/botoes.htm
Mas queria que aquela janela que aparece esteja: A do 'Tomas' por baixo desta e a do 'Tomás2' em baixo desta'
Não percebi como isso se faz, pois estou a começar a trabalhar com linguagens
Podiam-me dizer o código?
Obrigado.