2012-03-19 96 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