我试图调整,或破坏和调整窗口大小时重新应用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”,我想只能用“礼”来做到这一点,但搜索更多一些关于停用插件,我发现我不得不取消绑定的点击也因此,这里是代码,我不得不申请:
$(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,我发现了一个可能解决方案,但现在还有另一个问题... – 2012-01-10 17:14:37