Show Lightbox when a page loads Support
Lightbox, page, loads
Question
How can I show Lightbox when a page loads?
Answer
Sometimes it might be useful to have a Lightbox opened when a page is loaded. In order to achieve this, you need to have the following function set in your document's header:
<script type="text/javascript">
<!--
(function() {
if (!DMX.Lightbox.instance) {
window.setTimeout(arguments.callee, 800);
return;
}
DMX.Lightbox.instance.open('','http://www.awebsite.com', {title:'MyTitle'});
})();
//-->
</script>
As you can see the DMX.Lightbox.instance.open in the example is set to open an external URL. You can have anything referred in that position - image, page, video, flash file. If the file is inside the current website, a relative link is sufficient! Have a look at the other examples:
DMX.Lightbox.instance.open('','images/myimage.jpg', {title:'MyImage', width:640, height:480});
DMX.Lightbox.instance.open('','mypage.asp', {title:'MyPage'});
DMX.Lightbox.instance.open('','media/movies/mymovie.wmv', {title:'MyTitle'});
DMX.Lightbox.instance.open('','http://www.awebsite.com/flash/aflashfile.swf', {title:'AFlashFile'});
Then in {} you can use the following parameters:
title: 'MyTitle' ,
width: 200 - in pixels,
height: 200 - in pixels,
preset: 'PresetExactName',
group: 'GroupExactName'
For the preset: option you can choose between the following default presets: blue, border-art, classic, default, minimalistic, orange, paspartu and thin.
Give it a try and see what happens! I'd really appreciate your feedback on your results! If you have any questions just let me know!
Comments
Be the first to write a comment
You must me logged in to write a comment.