IE10显示<span>工具提示,缩短了

时间:2015-06-01 19:48:50

标签: javascript html css internet-explorer-10

我有一个<span>标签,我使用以下功能添加了'onmouseover'和'onmouseout'属性

function mOver(obj) {       
   document.getElementById('sw_duration_span').setAttribute("title","my title");              
   document.getElementById('sw_duration_span').style.display="block";
}

function mOut(obj) {
   document.getElementById('sw_duration_span').setAttribute("title", " ");
   document.getElementById('sw_duration_span').style.display=" ";
}

我的跨度块如下:

<span id="sw_duration_span" class="some_css_class" onmouseover="mOver(this)" onmouseout="mOut(this)" title="my title"></span>

当我在Mozilla和Chrome上测试时,这很好用!但在IE10中,onmouseover事件在几秒后消失。我不确定这里有什么问题!非常重要的是,我让它在所有三个或没有一个工作!

感谢任何帮助。

我的JSFiddle演示在这里: https://jsfiddle.net/m12rfz0L/2/embedded/result/

更新

我现在在控制台中收到错误消息ReferenceError:mOver未定义 - 这显然是错误的!我已经定义了两个函数

0 个答案:

没有答案