2010-02-25 49 views
0

它在本地机器上的Firefox上正常工作,但是当我在线上传文件时,它仅停止动画并显示静态图像。当我将文件上传到在线服务器时,jQuery图像悬停在Firefox上不起作用

View it here

的JavaScript我使用:

<script type="text/javascript"> 
$(document).ready(function() { 

$("ul.gallery li").hover(function() { //On hover... 

    var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver' 

    //Set a background image(thumbOver) on the <a> tag - Set position to bottom 
    $(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'}); 

    //Animate the image to 0 opacity (fade it out) 
    $(this).find("span").stop().fadeTo('normal', 0 , function() { 
     $(this).hide() //Hide the image after fade 
    }); 
} , function() { //on hover out... 
    //Fade the image to full opacity 
    $(this).find("span").stop().fadeTo('normal', 1).show(); 
}); 

});</script> 

任何想法,为什么它的发生! 解决方案?

+0

你正在加载jquery两次..那会是问题吗? – Ben 2010-02-25 22:10:35

回答

0

看完您的页面后,我看到图像尝试交换,然后几乎立即交换回来。看起来你正在调用.hover()的第二个函数,因为图像正在交换。

0

其实,这是有趣的,如果你在页面的末尾删除广告位:

<div style="text-align: center;">[...]</div> 

然后正常工作。

,您可以尝试住在萤火虫..

编辑:重新实际上,如果你只是删除图像中的广告,并留下它也能工作的包裹......

+0

没有我dint添加了任何广告,我正在测试一个免费的服务器,它们来自他们......不在我的控制之下。 – 2010-02-25 22:30:46

+0

我明白了,但看起来这个广告,或者任何注入它都有点负责任。如果你删除萤火虫中的元素,然后突然一切正常。 – Ben 2010-02-25 22:32:14

相关问题