jQuery的IE浏览器bizzare问题可能包装问题

jQuery的IE浏览器bizzare问题可能包装问题

本文介绍了jQuery的IE浏览器bizzare问题可能包装问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为新网站提供了自定义悬停工具提示。它很好用,直到我们发现它在IE中不会消失



我认为它与 live 侦听器到 mouseover 和 .wrap()命令

这里是snippit:

$ p $ $('。tooltip')。live('mouseover',function( ){
$ this = $(this).wrap('< span class =tooltip-wrap>< / span>');
...

这是



请注意,它适用于Chrome / Firefox,但不适用于IE



似乎无法解决它。

解决方案

我认为在IE中它与某些事情有关一个更好的问题是 - 为什么你要创建和销毁包装器+弹出菜单在每一个盘旋?这是一个学术问题?为什么不在第一次悬停时创建工具提示,然后在随后的盘旋中显示/隐藏它?像这样:



(我没有在新示例中尝试修复样式)


I have a custom hover tool tip for a new site. It works great until we noticed it doesn't go away in IE

I think it has to do with the combination of the live listener to mouseover and the .wrap() command

Here is that snippit:

$('.tooltip').live('mouseover', function() {
    $this = $(this).wrap('<span class="tooltip-wrap"></span>');
    ...

Here it is http://jsfiddle.net/HxGtA/8/

Notice it works in chrome/firefox but not in IE

Can't seem to fix it.

解决方案

I think in IE it has something to do with a stricter interpretation of the mouseover/mouseout, and the added element positioning is screwing it up.

But a better question is - why are you creating and destroying the wrapper+popup on every hover? Is this an academic question? Why not create the tooltip on the first hover, then show/hide it on subsequent hovers? Like this: http://jsfiddle.net/scEbS/6/

(I didn't try too hard to fix the styling in my new example)

这篇关于jQuery的IE浏览器bizzare问题可能包装问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 20:52