スライドショーを作成し、jQueryな画像)
-
05-07-2019 - |
質問
すい div
に含まれる要素の一つのコンテナ div
, に、どのようなスライドを通じて、この映画の一つ、一定のタイムアウトスライドは、現在表示部の左用アニメーション、スライドの次divからです。
私のHTMLするとどうなるのかわかりません
<div id="topMaps" style="height: 225px; overflow: hidden;">
<div>First slide - some content here</div>
<div>Second slide - some content here</div>
<div>... slide - some content here</div>
<div>n'th slide - some content here</div>
</div>
私が使っている以下のスクリプトのための本:
var currentSlide = 1;
var numSlides = -1;
var slideSpeed = 1000;
var timePerSlide = 3500;
function nextSlide() {
$('#topMaps div:nth-child(' + currentSlide + ')').hide("slide", { direction: "left" }, slideSpeed);
currentSlide += 1;
if (currentSlide >= numSlides)
currentSlide = 1;
$('#topMaps div:nth-child(' + currentSlide + ')').show("slide", { direction: "left" }, slideSpeed);
setTimeout(nextSlide, timePerSlide);
}
$(document).ready(function() {
numSlides = $('#topMaps div').length;
setTimeout(nextSlide, timePerSlide);
});
その上で使用すれば問題ありません。場合に nextSlide
関数が呼び出され、Firefoxの報告は以下のようなエラー:
o.easing[this.options.easing || (o.easing.swing ? "swing" : "linear")] is not a function
http://localhost/templates/front/default/js/jquery.js
Line 19
その追加 $('#topMaps div:nth-child(' + currentSlide + ')')
時計のパネルを開いているのがfirebugでコレクションを返しまの10の要素?Reallいいます。
そうです。
編集 きっかけになるかもしれないとの問題のセレクタを使用 $('#topMaps>div:nth-child(' + currentSlide + ')')
通知の >
).まだまだ動かないものです。
解決
なに答えたい、との サイクルのプラグイン?
他のヒント
かを設定することを推奨したIDの各部門および呼び出しでnextSlide()時のjs関数、試験のcurrentSlide変数を選択し、次のdiv なプログラムのブツができる少なくとも動作するようです図表などでは間違っている$('#topMaps div:n番目の子('+currentSlide+')')
所属していません StackOverflow