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
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:
- How do I put a pic beside a pic on my Myspace?Best solution by Yahoo! Answers
- How do I put a custom PSP firmware when I have 3.71 firmware?Best solution by krizka.net
- How do I put a picture on my page?Best solution by Yahoo! Answers
- How do I put a password on a zip folder?Best solution by Yahoo! Answers
- How do I get rid of that annoying popup on Yahoo home page?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.