...

View Full Version : Body Onload



cheechm
08-29-2007, 11:20 PM
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?
Thanks

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

cheechm
08-30-2007, 03: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.

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

cheechm
08-30-2007, 05:37 PM
http://particletree.com/features/lightbox-gone-wild/

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

@Francis

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;};
this.activate();
},


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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum