English  Italiano  Français  Español  Dansk  Deutsch  Deutsch  Português  Suomi 
Video Lightbox

Load jquery gallery video automatically

Apr 23, 2014

Q: Rather than have a thumbnail that needs to be clicked, is there support for the following: As soon as the page loads the video overlay also loads and starts to play immediately.

I would simply like to launch the overlay automatically without the need for the user to click a thumbnail or a text hyperlink.

A: You can start Video LightBox 2.8 gallery on page load.

You should set the following function in Video LightBox BODY section:

<script type="text/javascript">
$( function(){$(".videogallery a#mylink").overlay().load()});
</script>



You should also set id="mylink" for video link:

<!-- Start VideoLightBox.com BODY section -->
	<div class="videogallery">
	<a class="voverlay" id="mylink" href="http://www.youtube.com/v/31aWy9lcyJk?autoplay=1&rel=0&enablejsapi=1&playerapiid=ytplayer" title="How to Add Video to Your Website with Video LightBox .com"><img src="index_videolb/thumbnails/0.png" alt="How to Add Video to Your Website with Video LightBox .com" /><span></span></a><span class="videolb"><a href="http://videolightbox.com">Youtube Video Embed</a> by VideoLightBox.com v2.8</span>
	</div>
	<script src="index_videolb/jquery.tools.min.js" type="text/javascript"></script>
	<script src="index_videolb/videolightbox.js" type="text/javascript"></script>

<script type="text/javascript">
$( function(){$(".videogallery a#mylink").overlay().load()});
</script>

	<!-- End VideoLightBox.com BODY section -->

Related