我点击按钮后会显示一个转盘。问题是它不会立即初始化,因为div被隐藏,因此转盘在最初的几秒钟内被打破。这附近有吗?
$(document).ready(function(){
$("#category-slider").flexisel({
visibleItems: 6,
animationSpeed: 1000,
autoPlay: true,
autoPlaySpeed: 3000,
pauseOnHover: true,
enableResponsiveBreakpoints: true,
responsiveBreakpoints: {
portrait: {
changePoint:480,
visibleItems: 1
},
landscape: {
changePoint:640,
visibleItems: 2
},
tablet: {
changePoint:768,
visibleItems: 3
}
}
});
答案 0 :(得分:0)
为什么不在你取消隐藏div的同一时刻初始化你的旋转木马?例如。在单击函数包装器中。类似的东西:
$('#mybutton').one('click', function() {
$('#mydiv').show();
$("#category-slider").flexisel({
...
});
});