You can trigger Lightbox (Thickbox, PrettyPhoto) on page load with the following code.
Fancybox
$(document).ready(function(){ $("#lightbox").fancybox({ maxWidth : 700, maxHeight : 548, closeClick : false, }).trigger('click'); });
<a href="http://www.stcloudrox.com/lightbox.html" id="lightbox" class="fancybox fancybox.iframe"></a>
Fancybox w/Cookie (https://github.com/carhartl/jquery-cookie)
function openFancybox() { setTimeout( function() {$('#lightbox').trigger('click'); },100); } jQuery(document).ready(function() { var date = new Date(); var minutes = 30; date.setTime(date.getTime() + (minutes * 60 * 1000)); var visited = $.cookie('visited'); if (visited == 'yes') { return false; } else { openFancybox(); } $.cookie('visited', 'yes', { expires: date }); $('#lightbox').fancybox({ maxWidth : 700, maxHeight : 548, closeClick : false }); });
PrettyPhoto
$(document).ready(function() { $.prettyPhoto.open("image","title","description"); });
Thickbox
$(document).ready(function() { tb_show("", "announcement.html?height=400&width=500"); });
Recent Comments