Open Fancybox automatically
-
Hello,
we have an issue with fancybox. We use this plugin and it works fine.
But we want to open die lightbox automatically when a user visits the site. The popup should appear directly.
I don’t get it work. With this code the popup works but the lightbox (fancybox-container) is opening three times? What’s wrong with that?———————–
This is my code:
<div class=”redbox” ><p>Button-Text</p></div><div id=”lightbox” style=”display:none;”>
<class=”inside”>LIGHTBOX CONTENT</div>
</div><script type=”text/javascript”>
$(document).ready(function () {
var callFancy = jQuery(‘a[id=”lightbox-button”]’);
callFancy.trigger(‘click’);
});
</script>—————————
With this script it doesn’t work, there is no popup.<script type=”text/javascript”>
$(document).ready(function() {
$(“#lightbox-button”).fancybox().trigger(‘click’);
});
</script>I don’t know what I should do anymore.
I hope you can help me. Thanks a lot. I searched for answers via google but everything doesn’t work.
Best regards
Martina
- The topic ‘Open Fancybox automatically’ is closed to new replies.