Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Body Onload

  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post

    Body Onload

    Hello I am using Lightbox gone wild and to activate it you need to do this:
    Code:
    <a href="http://google.com" class="lbOn">Google</a>
    Is there a way of making it load when the body loads?
    Thanks

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Make what load when the page loads? That's just a static link. Can you clarify a bit please?

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post
    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.

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    32
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Do you have a link to the script?

  • #5
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post

  • #6
    New Coder
    Join Date
    Sep 2006
    Posts
    32
    Thanks
    0
    Thanked 3 Times in 3 Posts
    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:
    Code:
    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!

  • Users who have thanked jryoung for this post:

    cheechm (08-30-2007)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •