JavaScript代码求救,想做鼠标移入显示图片,移出隐藏
<script>window.onload=function(){vara1=document.getElementsByClassName("weizi");vara2...
<script>
window.onload=function(){
var a1=document.getElementsByClassName("weizi");
var a2=document.getElementsByTagName("li")
var i=0;
for(i=0;i<a2.length;i++)
{
a2[i].onMouseOver=function()
{
a2[i].ClassName="tv";
}
this..ClassName="tv-1";
}
}
</script>
<div class="DaoHang">
<div class="nav" >
<ul class="weizi">
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv">皇阿玛</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv">招娣</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >撸撸</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >三脚</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >老虎</a></li>
</ul>
</div>
</div> 展开
window.onload=function(){
var a1=document.getElementsByClassName("weizi");
var a2=document.getElementsByTagName("li")
var i=0;
for(i=0;i<a2.length;i++)
{
a2[i].onMouseOver=function()
{
a2[i].ClassName="tv";
}
this..ClassName="tv-1";
}
}
</script>
<div class="DaoHang">
<div class="nav" >
<ul class="weizi">
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv">皇阿玛</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv">招娣</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >撸撸</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >三脚</a></li>
<li ><a href="#" style="color:#FFFFFF;">
<img src="img/1-4.jpg" width="25px" height="25px" class="tv" >老虎</a></li>
</ul>
</div>
</div> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询