问题是,一旦我设置了这个函数:
$('#survey').flickable({segments:num_segments});我找不到重置、销毁或覆盖它的方法。因此,如果用户翻转平板电脑或调整浏览器窗口的大小,片段将以错误的宽度(在页面加载时设置)轻拍。提前谢谢。
发布于 2013-05-01 22:15:42
我运行了同样的问题,并看到了你的问题,所以看看代码内部,并提出了这个解决方案,它工作得很好:)
function readDeviceOrientation() {
if ($('.carousel-list')) {
$('.carousel-list').attr('data-segment-px', $('.carousel-container').width());
$('.carousel-list').flickable('segment', $('.carousel-list').flickable('segment'));
}
}
window.onorientationchange = readDeviceOrientationhttps://stackoverflow.com/questions/16020545
复制相似问题