Results 1 to 3 of 3

Thread: Need screen resolution popup script when clicking on a link.

  1. #1
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Need screen resolution popup script when clicking on a link.

    I need a script that would popup a window depending on the user screen resolution once they click on a link.

    For example if the user has a screen resolution of 1024 by 768 or lower they would get a pop up window with say page1.html when they click on the link, but if their screen resolution is 1152 by 864 or higher they get page2.html

    Thank you in advance for your help.

  2. #2
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Right know I have to use two scripts to popup the window to the correct page so that the popup is also the correct size.

    And I have two have two separate links for the user to choose from.

    It would be ideal if they just could click on one link and have the script determine based on their resolution what page to send them to.

    Blelow are the scripts I'm using

    Code:
    <SCRIPT LANGUAGE="JavaScript"> 
    
    <!-- Begin 
    function popUp(URL) { 
    day = new Date(); 
    id = day.getTime(); 
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=1,width=940,height=686,left = 170,top = 169');"); 
    } 
    // End --> 
    </script> 
    
    
    <script type="text/javascript"> 
    
    //Popup Window Script 
    
    function openpopup(popurl){ 
    var winpops=window.open(popurl,"","width=1040,height=778,resizable,scrollbars=yes,left = 120,top = 123") 
    } 
    </script> 
    
    and this is how the links on the page look 
    
    javascript:openpopup('Page1.html') 
    
    javascript:popUp('Page2.html')

  3. #3
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Could it be that this is only possible by using a javascript and PHP?

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
  •