2012-04-01 74 views
0

我有一個簡單的背景圖像,不斷從左向右移動。在除firefox以外的所有瀏覽器中都很好用(僅測試了11次);簡單的jquery動畫不工作在Firefox中

這是代碼:

$(document).ready(function() { 
     animateClouds();         
    }); 

    function animateClouds() { 
     $('#theclouds').animate ({ 
      'background-position-x': '+=5000' 
     }, 100000, 'linear', function() { 
      animateClouds();    
     }); 
    } 
+2

火狐不支持'背景位置x' CSS屬性 – safarov 2012-04-01 09:36:18

+0

順便說一句,你最好離這個動畫使用'setInterval'。如果有人在您的頁面上停留超過1:40秒,會發生什麼情況? – 2012-04-01 09:56:01

回答

2

有一個在CSS規範沒有background-position-x財產。無論如何,有些瀏覽器支持它; Firefox恰好不會。