Results 1 to 3 of 3

Thread: Javascript Onload HTML

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default Javascript Onload HTML

    Hi, i have a problem to make script like this one:
    https://www.sahabatnestle.co.id/kilau_fox/

    or this one:

    http://www.daniweb.com/forums/thread20849.html

    i only know that i can use body="onload", but have no idea how to make it like that

    I already searching some archive on dynamicdrive, but the only thing that close is this one :
    http://home.comcast.net/~jscheuer1/side/lightbox2.04a/
    Mr. John made this a couple time ago, but it's a lightbox.

    So are there any recommendation, or example that i can use?

    Thank you very much....
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are a number of scripts around that can do this. I currently favor FancyBox:

    http://fancybox.net/

    Another is LightWindow:

    http://www.p51labs.com/lightwindow/

    Dynamic Drive has its DHTML Modal window v1.1:

    http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    There are many others. In the case of the first two, look through the documentation of each to find out how to launch one of them without a link.

    The DD script already has a documented method to launch at load time.

    One thing you should get away from though is:

    body="onload"
    Which isn't real code anyway, but implies using the onload attribute of the body tag to run a script onload of the page. Using the body onload attribute potentially conflicts with other scripts that might want to use it or the window onload event. There are more efficient ways than waiting for the entire page to load. FancyBox may use jQuery's document.ready method, for instance. That method will not conflict with other onload type events.

    Pick a script that can do this and if you want more help, post a link to your best effort.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    davelf (01-03-2011)

  4. #3
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    thank you so much John, i used that fancy box, and work perfectly.

    The dynamicdrive one is great too, but may be you need to add an extra function, so the user can click outside the box to close it, instead click on the close button.
    _____________________

    David Demetrius // davejob
    _____________________

Bookmarks

Posting Permissions

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