Fancybox - 滚动/页面位置

发布于 2024-08-14 01:51:44 字数 227 浏览 4 评论 0原文

我试图在打开 fancybox iframe 时自动滚动到锚点,如下所示:www.example.com/posts#header。

它有点工作,但它滚动到错误的位置,要么太远,要么太远(大多是太远)。

我尝试使用 jQuery ScrollTo 插件,但它也会滚动到错误的位置,并且还会将页面从 fancybox“弹出”到整个窗口。

如果您提供有关如何实现此功能的任何提示,我们将不胜感激!

I am trying to automatically scroll to a anchor when opening a fancybox iframe like so: www.example.com/posts#header.

It kinda works but it scrolls to the wrong position, either too far up or way too far down (mostly way too far down).

I tried using the jQuery ScrollTo plugin but it also scrolls to the wrong position and additionally "pops out" the page from the fancybox to the whole window.

Would be thankful for any tips on how to get this working!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文