js鼠标移动到DIV后改变style
我这么写怎么没用?<script>window.onload=function(){varoEle=document.getElementsByName("img");f...
我这么写怎么没用?
<script>
window.onload = function() {
var oEle = document.getElementsByName("img");
for(i=0;i<oEle.length;i++){
oEle[i].onmouseover = function() {oEle[i].style.top="-350px";};
oEle[i].onmouseout = function() {oEle[i].style.top="0px";};
}
};
</script> 展开
<script>
window.onload = function() {
var oEle = document.getElementsByName("img");
for(i=0;i<oEle.length;i++){
oEle[i].onmouseover = function() {oEle[i].style.top="-350px";};
oEle[i].onmouseout = function() {oEle[i].style.top="0px";};
}
};
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询