所属分类:HTML网页,JS语言与代码
https://zhidao.baidu.com/question/16633 ... question_0
[code]<div id="t1"><img src="1.jpg"/></div>
<div style="display:none;" id="t2">内容,,,</div>
<script>
var t1=document.getElementById("t1");
var t2=document.getElementById("t2");
t1.onmouseover=function(){ t2.style.display="block";}
t1.onmouseout=function(){ t2.style.display="none";}
</script>[/code]
[code]<div id="t1"><img src="1.jpg"/></div>
<div style="display:none;" id="t2">内容,,,</div>
<script>
var t1=document.getElementById("t1");
var t2=document.getElementById("t2");
t1.onmouseover=function(){ t2.style.display="block";}
t1.onmouseout=function(){ t2.style.display="none";}
</script>[/code]