Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2004
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Javascript buttons and screen DPI

    I finished a script on one pc and tested it and it was working fine(96dpi). However when i tried it on another computer where the screen was set to 125dpi, the layout was completely mucked up. The text areas and buttons were too big. Is it possible to somehow make my script completely unaffected by the DPI of the users computer? Or if thats not possible, can i detect the DPI of a users screen so i can then redirect them to a version created for them? Thanks for reading.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just change your CSS. JS scripts are not effected by screen resolution per se, but the HTML layouts which might be generated by them might be themselves. for this reason, the solution lies in better CSS, not in the JS itself.
    *keep it simple (TM)

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Related: Adjusting Scale for Higher DPI Screens

    Otherwise, style an element to "1in" x "1in", and check its offsetWidth & offsetHeight properties (to get x & y DPI), I guess...
    Thanks in advance!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •