0
私が取り組んでいるプロジェクトで動作するように操作したjQueryコードが見つかりました。背景画像フェーダー - 最初の画像の前の遅延
私の主な問題は、最初のスライドが入るのにかかる時間が長くなるほど遅延が長くなることです。遅延は「5000」に設定されているため、最初のスライドをロードするのに5秒かかるので、白い背景が表示されます。ロード時に最初のスライドを表示するために微調整する必要があるものがあります。
function cycleBackgrounds() {
var index = 0;
$imageEls = $('.imageCon .slide'); // Get the images to be cycled.
setInterval(function() {
// Get the next index. If at end, restart to the beginning.
index = index + 1 < $imageEls.length ? index + 1 : 0;
// Show the next
$imageEls.eq(index).addClass('showImg');
// Hide the previous
$imageEls.eq(index - 1).removeClass('showImg');
}, 5000);
};
// Document Ready.
$(function() {
cycleBackgrounds();
});
'showImg'のクラスは起動イメージには機能しません。 –
ここで私はコードを見ていましたが、明白ではありませんでした。 – webmonkey237
それを聞いてうれしいです。時々私は第3セットが必要です。乾杯。 –