Getting *box to open on page load?

  • dyfrin
  • Expert
  • Expert
  • User avatar
  • Posts: 503
  • Loc: WI

Post 3+ Months Ago

Hi guys,
Trying to use slimbox (have used light/shadow can switch..) to load as soon as page is finished loading to alert people of an important change. Instead of an ugly alert window, an overlay with image is preferred.

The API shows javascript can initiate the overlay:
http://code.google.com/p/slimbox/wiki/jQueryAPI
Quote:
Slimbox 2 works as a jQuery plugin.
You can launch Slimbox 2 using Javascript to display a single image or a group of images.
Single image

Call the jQuery.slimbox() function with the following parameters:

jQuery.slimbox(url, description, options);

* url is mandatory, it's the URL of the image to display.
* description is optional, it's the image description text.
* options is optional, it's a javascript object where the keys are option names and the values depend on the key. The options are described in detail in the Slimbox manual. Example of options object: { captionAnimationDuration: 1, loop: true, overlayOpacity: 0.5 }

Examples:

jQuery.slimbox("tree.jpg");


I have tried both:
Code: [ Select ]
window.onload(jQuery.slimbox("image.jpg"));
window.addEvent("domready", function(){jQuery.slimbox('image.jpg')};);
  1. window.onload(jQuery.slimbox("image.jpg"));
  2. window.addEvent("domready", function(){jQuery.slimbox('image.jpg')};);


The slimbox/jquery is working fine if I use the rel="lightbox" on a link, and if I use onclick="jQuery.slimbox("image.jpg") so I know the script/css is working, just the initiation of the script is failing.


Any ideas on getting this to work, or a replacement to this idea?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • dyfrin
  • Expert
  • Expert
  • User avatar
  • Posts: 503
  • Loc: WI

Post 3+ Months Ago

Boy, I am getting too complicated:
Code: [ Select ]
<body onload="jQuery.slimbox('image.jpg')">

worked. Hate using body onload though.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 106 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.