Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Detroit, Michigan, USA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DOM-Javascript....From pixels and screens

    I created a division on the fly on this HTML file. I assigned the division a 10% width. What is the function that will allow me to know how many pixels on any screen, 10 % of the width represent?. If I wanted to create a square division...I could use percentage on ...i.e. the width...but not on the height. The height requires an absolute number (otherwise I will get a rectangle with height equaling 10% of the screen height....). Thanks a in advance.

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOM-Javascript....From pixels and screens

    A quick Google for "<code>javascript screen resolution</code>" brings up Javascript - Screen Resolution Detection - is that the kind of thing you want?

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DOM-Javascript....From pixels and screens

    Hi There

    Sorry, bit of a delay, problems with connection

    Have a look at 10% Square on my site. Feel free to look at the code, it uses screen.width and a maths function to get it to round the number ( as IE gets upset when it rounds thing wrongly)...Enjoy <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

Posting Permissions

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