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 2 of 2

Thread: Window object

  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Window object

    In my current javascript code, the window object is being used. But my issue is that if you are slightly zoomed in or out it is not placed correctly. So is there any way to make it take into account the browser zoom level?

    Code:
    windowHeight=$(window).height(),windowWidth=$(window).width(),
    Code:
    projectedTop=scrollPos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2))

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,446
    Thanks
    13
    Thanked 361 Times in 357 Posts
    the window object (which is also JavaScript's host object) corresponds to the browsers rendering area (it uses the AbstractView interface). you cannot *place* it somewhere.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Tags for this Thread

    Posting Permissions

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