Reputation: 1475
I'm using Fancybox 3's Ajax type to load a specific portion of a page into a Fancybox window that opens on a page with a button on it.
<a id="fancybox-link" data-fancybox data-type="ajax" data-src="/thePage.jsp .page" href="javascript:;">New Fancybox Link</a>
The Fancybox loads properly, and the proper content is loaded into the Fancybox, but once it's open and the animation has completed, the content of the Fancybox scrolls to the bottom of itself automatically.
I'm not sure why this is happening, and I just want the Fancybox to open the content and not scroll.
Upvotes: 1
Views: 658
Reputation: 8769
Most likely you have some focusable element at the bottom and it gets focus by default. You can disable that feature by setting autoFocus: false
Upvotes: 2