喜不燒我有以下的HTML佈局鼠標懸停,mouseOut事件在IE
<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);
}
Iam面臨IE瀏覽器中的一個問題。 IE 8,9甚至10。當我鼠標懸停剝離div,mouseover事件被解僱,但當光標移動鼠標懸停文本事件不會被解僱。
u能爲同一創建的jsfiddle? –
@Murali http://jsfiddle.net/xxY6b/ – nyfer