得到一个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