Meta 13 Project Blog
  • Home
  • Links
  • CMS
  • CSS
  • Ecom
  • Email
  • Flash
  • Google
  • HTML
  • Javascript
  • OS
  • PHP
  • SEO
  • SQL
Browse: Home / Thickbox

Thickbox

Auto Launch Lightbox On Page Load

By Bryce on June 28, 2010

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");
});

Posted in Javascript | Tagged lightbox, PrettyPhoto, Thickbox | Leave a response

Tags

.htaccess Advanced Custom Fields Bower c5 cms Composer Concrete 5 Concrete5 Cron CSS3 Cycle Cycle2 fancybox FancyBox2 Foundation Genesis Google Fonts Google Maps Google Webfonts Google Web Fonts Gravity Forms Grunt html5 HTML5 Boilerplate IE7 iPad iPhone jQuery lightbox Lists Magento Media Queries mobile pdf Plesk PrettyPhoto Responsive SASS SCSS static block Twitter typekit Video WordPress YouTube

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Recent Comments

  • Bryce on Responsive Email Templates
  • Justin on Mail Server Settings (Microsoft365)
  • Justin on Mail Server Settings (Microsoft365)
  • Bryce on Mail Server Settings (Microsoft365)
  • Justin on Mail Server Settings (Microsoft365)

Authors

  • Aaron Huisinga
  • Bryce
  • Darin
  • Jason
  • Josh
  • Justin
  • master
  • Nathan
  • nick
  • Paul

Archives

  • March 2016
  • July 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • September 2014
  • July 2014
  • June 2014
  • May 2014
  • December 2013
  • November 2013

Copyright © 2023 Meta 13 Project Blog. Powered by WordPress and Hybrid.