jquerycssfancybox-2

fancybox2 / fancybox causes page to to jump to the top


I have implemented fancybox2 on a dev site.

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.

Has anyone experienced this?


Solution

  • 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/