SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2004
    Location
    florida
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fullscreen / redirect

    I need a script that will detect the users screen resolution (in my case 800,1024,1600) and redirect them to the appropriate page(800.html,1024.html,1600.html) and have the new page open in fullscreen mode without scrollbars.

    any help would be great. I have spent many hours searching and have found individule scripts that do this but not one single one.

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:

    Code:
    <script type="text/javascript">
    var width = screen.width;
    
    if(( width != 800 ) && ( width != 1024 ) && ( width != 1600 ))
    width = 800; // set the default width to 800
    
    var filename = width + '.html';
    window.open(filename, 'fwin', 'fullscreen=yes');
    </script>
    -- lilleman

  3. #3
    SitePoint Zealot LAMA's Avatar
    Join Date
    Apr 2004
    Location
    Orlando Florida
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, this works wonderfully. But how do I make it so that if the resolution is = or > than 1024 then it shows the 1024 version.

    This way if you are running a big resolution you dont have to look at the small 800 version.

    is there a way to do this?

    also is there anyway that I can have it open in the same page, not a new window.
    Last edited by LAMA; May 24, 2004 at 12:51.
    My Designs Velocity Designs
    My Newest Creation Skin & Bone

  4. #4
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LAMA, try this:
    Code:
    <script type="text/javascript">
    var width = screen.width;
    
    if( width >= 1024 ) {
      width = 1024; // set the default width to 1024
    }
    
    window.location.href = width + '.html';
    </script>
    Sorry for the time it took me to reply, had taken a little pause from SitePoint...

    Yours, Erik.


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
  •