得到一個jQuery腳本工作,我在我的網頁上rotatePics jQuery腳本:無法在Firefox
$(document).ready(function(){
rotatePics(1);
});
function rotatePics(currentPhoto) {
var numberOfPhotos = $('.photos img').length;
currentPhoto = currentPhoto % numberOfPhotos;
$('.photos img').eq(currentPhoto).fadeOut(function() {
// re-order the z-index
$('.photos img').each(function(i) {
$(this).css(
'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
);
});
$(this).show();
setTimeout(function() {rotatePics(++currentPhoto);}, 5000);
});
}
我在主頁的我的頭部分以下內容:
<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
這裏在網頁的HTML:
<div id="imageanimation">
<table id="picturetable">
<tr>
<td class="photos"></td>
<td class="photos"></td>
<td class="photos"></td>
<td class="photos"></td>
</tr>
</table>
</div> <!-- close imageanimation div -->
<!-- Your website would not let me upload images -->
這裏是CSS:
#picturetable {
float:left;
height:212px;
margin:0 auto;
position:relative;
left:15px;
z-index:-1;
}
.photos img {
position: absolute;
}
.photos {
width: 212px;;
height: 212px;
overflow: hidden;
padding:5px;
padding-top:10px;
padding-bottom:10px;
}
我在做什麼錯?
首先需要說明什麼是錯的,什麼是不工作的,你得到一個錯誤? – 2010-10-19 15:29:29
那麼當你嘗試這個時,你會得到什麼錯誤或行爲? – JohnFx 2010-10-19 15:30:03
指向顯示問題的頁面的鏈接可能會爲您帶來更快的結果。 – 2010-10-19 15:30:40