1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

(ASK) Multi Window WP

Discussion in 'PHP & Perl' started by irfan666, Oct 9, 2015.

  1. irfan666

    irfan666 Newbie

    Joined:
    Oct 3, 2015
    Messages:
    14
    Likes Received:
    0
    Hi, Does anyone know how to make wordpress site autoload multi tab. The scenario is like this when im visiting my site it will automatically open several tab window with random posting per each tab.


    Thanks a lot
     
  2. davids355

    davids355 Jr. VIP Jr. VIP

    Joined:
    Apr 25, 2011
    Messages:
    10,422
    Likes Received:
    8,120
    Basically opening additional Windows but then displaying different pages of the site in each one?
    Im guessing a lot of browsers would block that though?
     
    • Thanks Thanks x 1
  3. irfan666

    irfan666 Newbie

    Joined:
    Oct 3, 2015
    Messages:
    14
    Likes Received:
    0
    Do you know how to do that? Please let me know. Thanks
     
  4. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    974
    Likes Received:
    680
    Occupation:
    Web/Bot Developer
    There is no way, to my knowledge, that one can programmatically launch a new tab using JavaScript. However, you could create several html post links with target="_blank" attributes and hide them via CSS, then invoke multiple jQuery click events to open them up.

    Code:
    <html>
    
    <head>
        <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
        <script>
             $(document).ready(function() {
                 $('#post-1').get(0).click();
                 $('#post-2').get(0).click();
                 $('#post-3').get(0).click();
             });
        </script>
    </head>
    
    <body>
        <a id="post-1" target="_blank" style="display:none;" href="http://google.com">Google</a>
        <a id="post-2" target="_blank" style="display:none;" href="http://en.wikipedia.org/wiki/Main_Page">Wikipedia</a>
        <a id="post-3" target="_blank" style="display:none;" href="http://stackoverflow.com/">Stackoverflow</a>
    </body>
    
    </html>
    
    That being said, davids355 is correct that most browsers will block this depending on their configuration.
     
    • Thanks Thanks x 1
    Last edited: Oct 10, 2015
  5. AbsoluteMig

    AbsoluteMig Newbie

    Joined:
    Oct 18, 2012
    Messages:
    14
    Likes Received:
    3
    I doubt you can get this to work on browsers nowadays...
    This is considered a popup or a popunder, depending.
     
  6. zotohost

    zotohost Registered Member

    Joined:
    Oct 25, 2015
    Messages:
    71
    Likes Received:
    4
    Yes your basically asking how to use popup's without any issues. popup's are big no no to browsers.