fancybox2 / fancybox使页面跳转到顶部 [英] fancybox2 / fancybox causes page to to jump to the top

查看:667
本文介绍了fancybox2 / fancybox使页面跳转到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发网站上实现了fancybox2。

I have implemented fancybox2 on a dev site.

当我使用fancybox时(点击链接等),整个html转移到它的后面 - 。我有它的工作正常在另一个演示,但是当我拖动相同的代码到这个项目,它跳到顶部。

When I engage the fancybox (click the link etc) the whole html shifts behind it - and goes to the top. I have it working fine in another demo, but when I drag the same code to this project it jumps to the top. Not only with the links to inline divs, but also for simple image gallery.

有没有人遇到过这个?

推荐答案

这可以用Fancybox 2中的帮手来完成。

This can actually be done with a helper in Fancybox 2.

$('.image').fancybox({
  helpers: {
    overlay: {
      locked: false
    }
  }
});

http://davekiss.com/prevent-fancybox-from-jumping-to-the-top-of-the-page/

这篇关于fancybox2 / fancybox使页面跳转到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆