크로스 페이드 슬라이드 쇼입니다. 나는이 아래의 코드에서 무엇을하는지 이해가 안 : rotatePics(1);
매개 변수의이 상수는 무엇을합니까?
HTML
<div id="photos">
<img alt="Glendatronix" src="../../images/glenda_200.jpg" />
<img alt="Darth Fader" src="../../images/fader_200.jpg" />
<img alt="Beau Dandy" src="../../images/beau_200.jpg" />
<img alt="Johnny Stardust" src="../../images/johnny_200.jpg" />
<img alt="Mo' Fat" src="../../images/mofat_200.jpg" />
</div>
JS
$(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);}, 4000);
});
}
어떤 상수 매개 변수입니까? – Madbreaks
간신히 읽기 쉽고 기본적인 질문에 대한 두 개의 상형 문자? – j08691