何が悪いのかわかりません (問題の行には複数のアスタリスクがあります) スライドショーです。JS セクションで、DW は、rotatePics 関数を含む行にエラーがあると私に言い続けます。
HTML部分は次のとおりです。
<div id=photos>
<img src="../imgs/dr_gonzalez.jpg" class=show alt="Dr. G">
<img src="../imgs/immunization.jpg" alt="SHOTZ!">
<img src="../imgs/senior_pet.jpg" alt="Former Puppies">
<img src="../imgs/vet_barnes.jpg" alt="Best doctor ever">
</div>
CSS 部分:
#photos img {position:absolute;
}
#photos{
width: 241px;
height: 329px;
overflow:hidden;
}
aaaaannnnnnddd デバッグが必要な JS:
$(document).ready(function() {
slideShow();
});
function slideShow() {
var current = $('#photos .show');
var next = current.next().length ? current.next() :
current.siblings().first;
current.hide().removeClass('show');
next.fadeIn().addClass('show');
setTimeout(slideShow, 3000);
}
$(document).ready(function() {
rotatePics(1);
}
***function rotatePics(currentPhoto){***
var numberOfPhotos = $('#photos img').length;
currentPhoto = currentPhoto % numberOfPhotos;
$('#photos img').eq(currentPhoto).fadeOut(function (){
$('#photos img').each(function (i)
{
$(this).css('zIndex', ((numberOfPhotos - i) +currentPhoto) numberOfPhotos);
});
$(this).show();
setTimeout(function ()
{
rotatePics(++currentPhoto);
}, 4000);
});
};