crazy values for window.outerWidth

后端 未结 3 1308
情书的邮戳
情书的邮戳 2021-01-25 04:02

window.outerHeight / window.outerWidth

are this values not in pixels ?

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_inner_outer

(screen

相关标签:
3条回答
  • 2021-01-25 04:30

    Did you set your doctype at the top of your HTML, I remember this was giving me an issue awhile back. Try putting

    <!DOCTYPE html>
    

    before your opening tag

    0 讨论(0)
  • 2021-01-25 04:36

    //if you need the screen width and height

    //Screen height

    var height = screen.height
    

    //Screen Width

    var width = screen.width
    


    //if you want to know what the code you use do:

    Get the window's height and width: (including toolbars/scrollbars):

    var w = window.outerWidth;
    var h = window.outerHeight;
    

    source:http://www.w3schools.com/jsref/prop_win_outerheight.asp

    Get the window's height and width: (NOT including toolbars/scrollbars):

    var w = window.innerWidth;
    var h = window.innerHeight;
    

    source: http://www.w3schools.com/jsref/prop_win_innerheight.asp

    0 讨论(0)
  • 2021-01-25 04:44

    Grrrmppf

    i not realy use IE or edge and chrome behaves different eg ZOOM is on a domain level in opposite to ie and edge where it is on a global level

    problem was i had pagee zoom on

    0 讨论(0)
提交回复
热议问题