Pop under

Discussion in 'JavaScript' started by dukeofism, Jan 24, 2010.

  1. #1
    Can anyone point me in the direction to creating a pop up/ under script for my site. I have been working on one combining php/java script, but it seems that this generally gets blocked. Is there a way to have popups appear that do not get blocked?

    Here is my attempt:

    <html>
    <head>
    <?php
    $count=0;
    while( $count< 3)
    {
    	echo "<script>
    		win".$count."=window.open('http://www.url-to-open.html')
    		win".$count.".blur()
    		window.focus()
    	</script>";
    	$count++;
    }
    ?>
    </head>
    <body>
    <h1>Window 1</h1>
    </body>
    </html>
    Code (markup):
    So after looking around doing a bit more research, I have decided that most likely I want to use javascript and onclick to create the pop ups.
    Is it possible to have a user click a link, open X popUNDERS and then in the main window direct the user to the intended link?

    Any help is greatly appreciated!
     
    dukeofism, Jan 24, 2010 IP
  2. harrierdh

    harrierdh Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Many users will have popups blocked or turned off. A simple way to do this would be to create a div box on the fly that is off the screen (left: -400px).

    Then when you want the box to show just change it's location to somewhere on the existing screen. It's not really a popup. It's more like a light box.
     
    harrierdh, Jan 25, 2010 IP