View Full Version : Body Onload

08-30-2007, 12:20 AM
Hello I am using Lightbox gone wild and to activate it you need to do this:

<a href="http://google.com" class="lbOn">Google</a>
Is there a way of making it load when the body loads?

08-30-2007, 03:18 PM
Make what load when the page loads? That's just a static link. Can you clarify a bit please?

08-30-2007, 04:11 PM
Well clicking that link opens a webpage inside a modal box (lightbox gone wild) however I want that page to open in a lightbox on the loading of the other page.

08-30-2007, 06:23 PM
Do you have a link to the script?

08-30-2007, 06:37 PM

08-30-2007, 07:52 PM
Found these suggestions from the link you gave:
# Jaisen Mathai · 1 year ago


You need to call the initialize function to reinit the lbOn anchors. I took the onload handler off for the initialize function and just call it dynamically everytime new links with lbOn are added to the document. Works like a charm for me.

and this:
In regards to the onload lightbox effect, can you just make it activate after initiate like the following:

initialize: function(ctrl) {
this.content = ctrl.href;
Event.observe(ctrl, ‘click’, this.activate.bindAsEventListener(this), false);
ctrl.onclick = function(){return false;};

There are other suggestions. Do a search on the page for onload. Good luck!