javascript 这样传参正确吗?
functionmouseover(val1,val2){val1.style.visibility="hidden"val2.style.visibility="vis...
function mouseover (val1,val2)
{
val1.style.visibility="hidden"
val2.style.visibility="visible"
}
<input id="box" class="container1" type="checkbox" name="box" style="z-index:1;"onMouseOut="mouseover(this,pic);"> <img name="pic" id="pic" class="container2" src="xin.jpg" style="z-index:2; " onMouseOver="mouseover(this,box);">
我调试时系统提示“缺少对象” 展开
{
val1.style.visibility="hidden"
val2.style.visibility="visible"
}
<input id="box" class="container1" type="checkbox" name="box" style="z-index:1;"onMouseOut="mouseover(this,pic);"> <img name="pic" id="pic" class="container2" src="xin.jpg" style="z-index:2; " onMouseOver="mouseover(this,box);">
我调试时系统提示“缺少对象” 展开
展开全部
把this改成相对应的id!
<script>
function mouseover (val1,val2)
{
val1.style.visibility="hidden"
val2.style.visibility="visible"
} </script>
<input id="box" class="container1" type="checkbox" name="box" style="z-index:1;"onMouseOut="mouseover(box,pic);"> <img name="pic" id="pic" class="container2" src="xin.jpg" style="z-index:2; " onMouseOver="mouseover(pic,box);">
<script>
function mouseover (val1,val2)
{
val1.style.visibility="hidden"
val2.style.visibility="visible"
} </script>
<input id="box" class="container1" type="checkbox" name="box" style="z-index:1;"onMouseOut="mouseover(box,pic);"> <img name="pic" id="pic" class="container2" src="xin.jpg" style="z-index:2; " onMouseOver="mouseover(pic,box);">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询