How to call a popup from a link inside another popup?

How do I put a lightbox/fancybox auto-popup on my landing page without the user have to click anything?

  • I want people to get a lightbox/fancybox popup with a short intro video when they get to my website. Optionally, there would be a 'Continue to Site' link. An example would be the http://fancybox.net/ site itself. I am currently having users click on a link for the fancybox, but i want it to popup automatically

  • Answer:

    As says, you can trigger a click in JavaScript. It's actually just as simple to do it in plain JavaScript without jQuery: document.getElementById("fancybox-link").click();

Harry Glaser at Quora Visit the source

Was this solution helpful to you?

Other answers

Whatever you are running now onclick event, that you need to run onload event. For example to load a simple pop up run this- <html> <head> <script type="text/javascript"> window.open("http://rediff.com"); /*window.open(any sample webpage);*/ </script> </head> <body>test</body> </html> Basically there are lot of ways and when you already have done that (" I am currently having users click on a link for the fancybox, but i want it to popup automatically")... then you can execute the same on page load. Please have a look at these for further explanation http://www.w3schools.com/jsref/event_body_onload.asp http://api.jquery.com/ready/ http://api.jquery.com/load-event/

Kuntal Chandra

The correct answer is "don't do that".  If a user wants to see it, they'll click on it.  Forcing a user to do anything is a bad idea.  _Especially_ video / audio.

Brandon Paluzzi

You can trigger a click event on a hidden (or shown) link which has fancybox attached to it. You can use $('a#hidden-fancybox-link').trigger('click');

Haralan Dobrev

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.