Reputation: 169
I am using the fancybox plugin for my web app. I am using it to display a simple tutorial for a first time user. When you first use my app you see the tutorial automatically. I use JQuery to trigger the link to open the modal once the page loads.
jQuery to trigger:
$(document).ready(function() {
$('#tutorial').trigger('click');
});
My link that opens the fancybox modal:
<a id="tutorial" href="#profile-tutorial" class="fancybox-open"> Profile Tutorial </a>
Now, when the page loads it automatically pops up, but some reason it loads halfway down the page. But if I click the link directly, it loads in the middle just fine. I have no idea what could be causing this. What could it be?
Thanks!
Upvotes: 0
Views: 228
Reputation: 1689
Trigger the click on load should solve your problem:
$(window).load(function () { $('#tutorial').trigger('click'); });
Upvotes: 2