1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to make pop-up on site load ?

Discussion in 'JavaScript' started by vic_msn, Oct 8, 2008.

  1. #1
    I have come across few scripts like
    greybox, thickbox,etc

    They are used to create pop-up when you click a link or a image.
    eg: http://puke.in/ Click the Example 1
    It opens a pop-up box.
    script used : http://jquery.com/demo/thickbox/

    My need:
    I need that box to pop-up as soon as the page loads.
    Please help me how to do this.
    If not possible with this script
    recommend me a script free/paid that can create these kind of ajax pop-up
    with
     
    vic_msn, Oct 8, 2008 IP
  2. happpy

    happpy Well-Known Member

    Messages:
    926
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    120
    #2
    this is no POPUP, this is a DIV-layer

    a popup is a totally new window.

    you can achieve such a div-layer on loading easily.

    if you want i give you a complete solution for $10 paypal.

    i have no time to do it for free.
     
    happpy, Oct 8, 2008 IP
  3. djzmo

    djzmo Active Member

    Messages:
    165
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    No. Don't waste your $10 for this little thing.

    Simply add the code to your body onload.

    Here is a working example with Greybox.
    <body onload="GB_show('Google rox!', 'http://google.com');">
    Code (markup):
     
    djzmo, Oct 8, 2008 IP
    vic_msn likes this.
  4. vic_msn

    vic_msn Well-Known Member

    Messages:
    2,233
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    155
    #4
    Thanks a lot..
    But I think its for GreyBox.. I am using the ThickBox script
    is there a similar workaround for it ??
    EDIT:
    Its possible I used tb_show instead of GB
    thanks djzmo
    you can see it at http://puke.in/

    but its not working in IE can you help ??
     
    vic_msn, Oct 9, 2008 IP
  5. djzmo

    djzmo Active Member

    Messages:
    165
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Sorry for the late respond.

    Try to add the function into your (document).ready.

    Example:
    $(document).ready( function()
    {
     tb_show('The title', 'thepage.html?width=300&height=300', false);
    });
    Code (markup):
    I haven't tested it anyway.
     
    djzmo, Oct 11, 2008 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    I wrote my own library to handle that sort of thing - feel free to use it, though it is designed for content inlined in the markup not at a separate address - if you want to load them from a separate address you could simply put an IFRAME in the advert div.

    Not well documented yet though.
     
    deathshadow, Oct 11, 2008 IP