SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Resolution.

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know if there's any way to determine what resolution an user has?

  2. #2
    SitePoint Member
    Join Date
    Feb 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TigerMilk if i understood your question right you can simply follow this code:


    <!-- THREE STEPS TO INSTALL RESOLUTION PAGE:

    1. Paste the coding into the HEAD of your HTML document
    2. Add the last code into the BODY of your HTML document
    3. Be sure to update the resolution pages to ones on your site -->

    <!-- STEP ONE: Copy this code into the BODY of your HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    function redirectPage() {
    var url640x480 = "http://www.yoursite.com/640x480";
    var url800x600 = "http://www.yoursite.com/800x600";
    var url1024x768 = "http://www.yoursite.com/1024x768";
    if ((screen.width == 640) && (screen.height == 480))
    window.location.href= url640x480;
    else if ((screen.width == 800) && (screen.height == 600))
    window.location.href= url800x600;
    else if ((screen.width == 1024) && (screen.height == 768))
    window.location.href= url1024x768;
    else window.location.href= url640x480;
    }
    // End -->
    </script>

    <!-- STEP TWO: Copy this code into the BODY of your HTML document -->

    <center>
    <form>
    <input type=button value="Enter!" onClick="redirectPage()">
    </form>
    </center>

    <!-- STEP THREE: Don't forget to update the URLs in the code above! -->

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>

    <!-- Script Size: 1.29 KB -->

    If that is not what you wanted you can also try looking at http://javascript.internet.com/user-details/ thats were i found this at.

    Hope This Help You
    Taters

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks taters
    but I found another way...

    <SCRIPT LANGUAGE="javascript">
    if (screen.width == 1600)
    {parent.location.href='1600page.html'}
    if (screen.width == 1280)
    {parent.location.href='1280page.html'}
    if (screen.width == 1152)
    {parent.location.href='1152page.html'}
    if (screen.width == 1024)
    {parent.location.href='1024page.html'}
    if (screen.width == 800)
    {parent.location.href='800page.html'}
    if (screen.width == 640)
    {parent.location.href='640page.html'}
    if (screen.width <= 639)
    {parent.location.href='text.html'}
    </SCRIPT>

    This autodirects the user to the appropriate page..

  4. #4
    SitePoint Member
    Join Date
    Feb 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yeah that will work to. Well im glad you resolved the problem just wish i could have been more help.

    Taters

  5. #5
    SitePoint Enthusiast Vman's Avatar
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hope you don't mind me asking.

    Though why do you want to redirect the user to a different page depending on their screen resolution?

    I understand the benefits of different pages for different browsers, though even then I find it easier to just put it all in 1 page.

    Just curious to see if you have some kind of cool design that has to be customised for each resolution.

    PS. That is a nice solution you came up with.

  6. #6
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    java redirect

    Tiger,
    this looks like just what i am looking for, since i am working with sliced images, and they pull appart around 800px,
    is there a noticable delay in page loading?
    Can a viewer's resolution be detected at all times and quickly?
    and finally, when i link to other pages within the site, which "version" of that page do i specify in hyperlink?
    Thanks for any response

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, let's see...
    There are no delaying at all and the resolution can be detected ón any page.
    I created a directory for every resolution.

    =)
    Cheers!

  8. #8
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Tiger !


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
  •