2009-12-11 36 views
0

我正在使用jQuery Cycle插件來旋轉site上的一系列圖像。 Safari中的圖像看起來很不錯,但它們在Firefox的頂部約有4個像素。很顯然,在相交線上保持定位是非常重要的。jQuery - 循環插件 - 圖像定位

我將不勝感激一些幫助定位該元素,以便cycle.js不會移動它。

謝謝。

回答

0

原來,這是浮動元素和循環代碼的絕對定位之間的衝突。

我用另一個解決方案替換它,實際上工作正常。

<script type="text/javascript"> 
$(function(){ 
     setInterval("rotateImages()", 4000); 
    }); 

    function rotateImages() { 
     var oCurPhoto = $("#slideshow div.current"); 
     var oNxtPhoto = oCurPhoto.next(); 
     if (oNxtPhoto.length == 0) 
      oNxtPhoto = $("#slideshow div:first"); 

     oCurPhoto.removeClass('current').addClass('previous'); 
     oNxtPhoto.css({ opacity: 0.0 }).addClass('current').animate({ opacity: 1.0 }, 2000, 
      function() { 
       oCurPhoto.removeClass('previous'); 
      }); 
} 
</script>