jCarouselLiteプラグインを再調整しようとしていますが、ウィンドウのサイズを変更するときに破棄して再適用しようとしていますが、それは...その「ページ」にリサイズウィンドウでjCarouselLiteを再適用または調整する
をスクロールするメニューをナビゲートするとき、私はサイズ変更でこれを使用するtryied、およびjcarouselliteを再適用するが、それは働いていなかったしている場合は、:
$('#mega').jCarouselLite = null;
これを私が使用しているコードですが、jcarouselLiteを再適用し続けると、カルーセルが狂ってしまいます!
$(document).ready(function(){
w = $(window).width();
h = $(window).height();
$('#mega li').css('width',w);
$('#mega li').css('height',h);
$('#mega').jCarouselLite({
circular:false,
vertical:true,
speed:1000,
visible:1,
btnGo:["#home", "#comofunciona", "#porquemegafome", "#contato"]
});
});
$(window).resize(function() {
w = $(window).width();
h = $(window).height();
$('#mega li').css('width',w);
$('#mega li').css('height',h);
$('#mega').jCarouselLite({
circular:false,
vertical:true,
speed:1000,
visible:1,
btnGo:["#home", "#comofunciona", "#porquemegafome", "#contato"]
});
});
SOLUTION:
「idrumgood」、私は「LI」でこれを行うにしようとしていたが、プラグインを無効化についてもう少し探して、私はクリックをアンバインドする必要があることを発見
$(window).resize(function() {
$('#mega').jCarouselLite = null;
$('#home, #comofunciona, #porquemegafome, #contato').unbind('click'); //buttons I defined on btnGo option
runCarousel(); //again
aClick(); // function where I get the li index and save into a hidden input, on resize it keeps li position! :)
});
おかげでとにかくidrumgood(それは私が与えることができる最高のアドバイスについてです、あなたのマークアップなし)の代わりに再初期化カルーセルのサイズを変更し、何が起こるか見ウィンドウ上のこれらの要素のサイズを変更してみてください、私は可能性を発見しました解決策、しかしもう一つの問題が今ある... –