Forum Moderators: open
I'm having trouble setting up a lightbox splash page. The lightbox functionality works well when I have an image with a surrounding href and specified rel
e.g.
<a href="image.gif" rel="lightbox" id="splash-image"><img src="image.gif" width="200" height="200" alt=""/></a> but what I'm trying to achieve is when the page is visited the lightbox frame will be expanded, displaying the above image. (The image should not be visible on the actual index.php page, so possibly set the style to display:none)
How can I execute the onclick event for that link once the document has loaded?
I'm not intending to use cookies for this, because the idea is to only display the image on the home page, which has it's own template.
Is there a better way of doing this? I haven't posted any of the Lightbox code, because I'm assuming most of you know the funtionality. Also, I didn't feel it necessary to include dtd and other html.
Extract from lightbox.js
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function'){
window.onload = func;
} else {
window.onload = function(){
oldonload();
func();
}
}
}
addLoadEvent(initLightbox); // run initLightbox onLoad
Thanks for any replies.