其他分享
首页 > 其他分享> > js鼠标移入事件

js鼠标移入事件

作者:互联网

鼠标放到a标签显示盒子1,鼠标放到b标签显示盒子2,鼠标放到c显示盒子3,盒子1,2,3放在同一位置,其js代码如下:

window.onload = function (){
var oDiv1 = document.getElementById('zhuYe3-2b');
var oDiv2 = document.getElementById('zhuYe3-2e');
var oDiv3 = document.getElementById('zhuYe3-2f');
var oDiv4 = document.getElementById('zhuYe3-2g');
var oDiv5 = document.getElementById('zhuYe3-2c');
var oDiv6 = document.getElementById('zhuYe3-2d');
oDiv1.onmouseover = function() { oDiv2.style.display = 'block';
oDiv3.style.display = 'none';
oDiv4.style.display = 'none';
}
oDiv5.onmouseover = function() { oDiv3.style.display = 'block';
oDiv2.style.display = 'none';
oDiv4.style.display = 'none';
}
oDiv6.onmouseover = function() { oDiv4.style.display = 'block';
oDiv2.style.display = 'none';
oDiv3.style.display = 'none';
}
}

标签:style,鼠标,none,js,zhuYe3,var,document,移入,display
来源: https://www.cnblogs.com/sun777/p/15732228.html