我正在尝试在 iScroll 4 “ rel="nofollow">Fancybox 但没有任何乐趣。
iScroll 附着在内容上,你可以用手指推动它使其滚动,但当你松开它时它会弹回来。它的行为与内容适合其容器时的行为一样。
I'm trying to use iScroll 4 within a Fancybox but with no joy.
iScroll attaches to the content, and you can push it with your finger to make it scroll, but when you let go it bounces back. It's behaving as it does when the content fits within its container.
发布评论
评论(1)
解决方案是在 Fancybox 出现后立即对 iScroll 对象调用
refresh()
:使用 Fancybox 的推荐方法是将内容隐藏在
The solution is to call
refresh()
on your iScroll object immediately after the Fancybox appears:The recommended way to use Fancybox is to hide your content in a
<div style='display:none'>
or similar, but that prevents the browser from performing any layout on it, and hence prevents iScroll from knowing how big it is.