Mouseover,Mouseout事件未在IE中启动
Mouseover ,Mouseout event not firing in IE
嗨,我有下面的html布局
<div id="stripe_container" style="top: 0px; border: 1px solid rgb(235, 116, 41);
background: none repeat scroll 0% 0% rgb(243, 232, 151); position: fixed; height: 30px;
width: 100%; left: 0px; z-index: 99999999; font-size: 14px; font-family: Verdana;
cursor: pointer;" class="">
<div id="stripe_rollover" style="height: 30px; background-color: transparent; z-index:
99999999; left: 0px; width: 97%; position: fixed;"></div>
<div id="stripe_text_left" style="margin-top: 5px; margin-left: 15px; color: black;
float: left;">Text Test</div>
<div id="stripe_text_right" style="top: 4px; right: 40px; cursor: pointer; position:
absolute; float: right;">Mouseover</div>
下面是我的js代码
<script>
var x;
stripe_rollover.onmouseover=function(){
x=document.createElement('div');
x.style.height='30px';
x.style.width='40px';
x.style.backgroundColor='#000000';
var stripe_container=document.getElementById('stripe_container');
stripe_container.parentNode.insertBefore(x,stripe_container.nextSibling);
}
stripe_rollover.onmouseout=function(){
x.parentNode.removeChild(x);
}
我在IE浏览器中遇到了一个问题。IE 8,9甚至10。当我将鼠标悬停在strip-div上时,将触发mouseover事件,但当光标移动到mouseover文本上时,不会触发该事件。
这将解决您的问题(示例)
function mouseOver_handler(){
// ...
}
function mouseOut_handler(){
// ...
}
stripe_rollover.onmouseover = mouseOver_handler;
stripe_text_left.onmouseover = mouseOver_handler
stripe_text_right.onmouseover = mouseOver_handler;
stripe_rollover.onmouseout = mouseOut_handler;
stripe_text_left.onmouseout = mouseOut_handler
stripe_text_right.onmouseout = mouseOut_handler;
相关文章:
- 从IE中的不同元素调用时,文件输入控件未正确启动
- IE 11未在SVG地图上启动Mouseenter或Mouseleave事件
- 是否可以从在Firefox或IE的网页中运行的Javascript启动Windows进程
- IE窗口失去了对任何XMLHttpRequest启动Angular应用程序的关注
- jQuery.done函数未在IE中启动
- window.onload未在IE中启动
- Mouseover,Mouseout事件未在IE中启动
- jwPlayer sendEvent 未在 IE 中启动
- 当正文调整大小时,IE在调整大小时启动
- 使用javascript在html中启动和停止嵌入音乐仅适用于IE
- IE 10 keyup/keydown未使用jQuery 1.10.1启动
- onChange不在Safari的下拉列表中启动,适用于IE、FF、Chrome和;歌剧
- IE 11企业模式在我们的应用程序中自动启动
- firefox上的Javascript函数问题没有通过jquery键盘输入启动计数器(在Chrome和IE上工作)
- 如何只等待文件.readyState在IE中,而在所有其他浏览器中立即启动
- 如何访问IE XHTML DOM+JS引擎,而无需启动浏览器本身
- 不能在Selenium中启动带有WebDriverJs的ie浏览器
- jQuery flash对象点击事件未在IE或Chrome中启动
- $(document).ready在IE中只启动一次,但在Firefox中有效
- 卸载activex后,以管理员模式重新启动IE浏览器