在iPad上定位更改后,Fancybox无法重新定位

时间:2014-05-12 14:52:39

标签: ios ipad fancybox orientation

当我将iPad从纵向旋转到横向并再回到纵向时,fancybox图像会在左侧显示神秘的填充。另外,在更改旋转之前,我无法向左或向右滚动,之后我可以向左滚动。请参考图像(观察背景!)以便更好地理解。

This is the screen before changing rotations This is the screen after changing rotations This is the screen after scrolling to the left

我已经尝试过添加fancybox的重新定位方法:

$(window).bind('orientationchange', function(event) {
  $.fancybox.reposition();
});

之前有人经历过这种情况,或者可以猜出它可能来自哪里? 任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:5)

在使用jQuery mobile尝试很多东西并在Fancy Box中调用各种函数后,我想出了一个非常简单的修复。

我只是将以下参数添加到我的fancybox初始化程序中:

autoCenter  : true

您可以在此处找到有关此设置的文档:http://fancyapps.com/fancybox/#docs

不能保证这会为你解决,但我希望如此!

PS:这可能至少需要2.1.5版本的Fancy Box。

相关问题