2010-11-30 135 views
0

我制作了一个脚本,可以在除某些Internet Explorer之外的所有浏览器中使用。我似乎无法弄清楚为什么一些Internet Explorer的工作,而其他人不这样做。在办公室,4个Internet Explorer 8的版本8.0.6001.18702完美工作,而另外4个Internet Explorer的8 @版本8.0.6001.18702(完全相同的浏览器)无法正常工作。我们都有Windows XP和所有最新的更新。Internet Explorer中的JQuery脚本问题(2)

请使用Firefox,safari,chrome,...以及随后的Internet Explorer访问http://www.stardekk.be/voorontwerp/verco/(7,8无关紧要)。

问题出现在网站的顶端。拇指应该有一个覆盖层,当徘徊的时候;覆盖层应该消失,应该出现一个工具提示。

我希望有人可以帮助我,因为50%的Internet Explorer的工作,50%不。

谢谢

$(window).load(function() { 
    $("#gallery div img").after('<div class="overlay"></div>'); 
    $(".overlay").css({"position":"absolute", "z-index": "30", "background": "url('images/overlay.png')", "top": "0", "left": "0", "width": "241px", "height": "146px"}); 

    var trans = $.browser.msie ? 0.8 : 1; 

    $('.overlay').hover(function() { 
     $(this).stop().fadeTo("fast", 0, function() { $(this).css("background", "transparent") }); 
    }, 
    function() { 
     $(this).stop().css("background", "url('images/overlay.png')").fadeTo("fast", trans); 
    }); 
}); 
+0

拇指在IE9(测试版)中正常工作。您是否尝试过Emulate-IE7元标记? http://davidwalsh.name/ie8-emulate-ie7 – 2010-11-30 08:48:36

+0

使用IE7,它适用于我(这是因为PNG丑,但工作。)无论如何,仿真IE-7应该避免。如果可能的话,从IE6&7开始向前移动,并且在任何地方兼容。 – Shikiryu 2010-11-30 09:16:15

回答

0

你尝试更换

$(window).load(... 

$(document).ready(... 

它可能来自连接窗口时,你试过没有装载你的脚本。