Popup on page load

Discussion in 'HTML & Website Design' started by drew68, Jun 30, 2012.

  1. #1
    anyone know how i can enable this feature? thru lightbox perhaps or?

    wanting a popup when someone comes to my website. i have an image that's 447x585.

    thanks..
    drew
     
    drew68, Jun 30, 2012 IP
  2. t3ster

    t3ster Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You could use Fancybox and then create an invisible anchor for your image with all options etc. like you would normally do (just see Fancybox docs)

    Then just add the following code to your page
    
    <script type="text/javascript">
        $(document).ready(function() {
            $("#hidden_link").fancybox().trigger('click');
        });
    </script>
    HTML:
     
    t3ster, Jul 1, 2012 IP
  3. sarkar1990

    sarkar1990 Member

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Use any popup jquery plugin. Do you want it to load as soon as a page starts loading?
     
    sarkar1990, Jul 1, 2012 IP
  4. Avener

    Avener Well-Known Member

    Messages:
    250
    Likes Received:
    24
    Best Answers:
    1
    Trophy Points:
    135
    #4
    <script language="JavaScript">
    
    function pop() {
    pop1();
    }
    
    function pop1(){
    var W1 = window.open('DREW68 - PUT YOUR WEBSITE LINK HERE','Popup1',"toolbar=no,status=no,location=yes, directories=no,menubar=no,scrollbars=yes,resizable=yes,width=160,height=160");
    W1.focus();
    W1.moveTo(50,150);
    }
    
    </script>
    Code (markup):
    In between the <body> tags you'll need something that executes the javascript above.
    This will do the trick:

    <body onload="pop()" >
    Code (markup):
     
    Avener, Jul 1, 2012 IP