2012-03-19 97 views
-2

我写的代码,看到在Firefox和小虫子的错误中铬Mozilla Firefox bug或..?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Mozila Firefox</title> 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
    <script> 
    $(function(){ 
     $(window).scroll(function(){ 
      if ($(window).scrollTop() == $(document).height() - $(window).height()){ 
       alert('1'); 
      } 
     }); 
    }); 
    </script> 
</head> 
<body> 
CONTENT FOR SCROLL 
</body> 
</html> 

当我滚动这个页面在Firefox我收到错误覆盖黑色透明背景的浏览器。

在铬只是越来越多的警报。

关闭在Firefox中的标签! 直播:http://forum.xeksec.com/habr/mozilla_crash_or_wtf/

+0

不知道是否有帮助,但我可以证实我这个bug在FF11 你的想法是知道滚动何时到达文档的末尾? – haltabush 2012-03-19 21:16:25

+0

@haltabush,是的,我想知道当scroo到达末尾) – Isis 2012-03-19 21:23:34

回答

1

编辑: 以上并不总是奏效。其实,我查了一些解决方案,各地,包括在这里堆栈溢出。其他通常的建议有相同的问题(例如Alert using Jquery when Scroll to end of Page) 我在Ubuntu上使用FF11。

我认为这是一个性能问题。如果你把你的maxscroll这样在它的工作原理(至少对我来说)一个变量 这里是我的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Mozila Firefox</title> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
    <script> 
    $(function(){ 
     var maxScroll = $(document).height() - $(window).height(); 
     $(window).scroll(function(){ 
      if ($(window).scrollTop() == maxScroll){ 
       alert('1'); 
      } 
     }); 
    }); 
    </script> 
</head> 
<body> 
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> 
</body> 
</html> 
+0

哼,它的工作,它不再。我们会找到解决方案:) – haltabush 2012-03-19 21:30:43