crazy values for window.outerWidth

后端 未结 3 1363
情书的邮戳
情书的邮戳 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: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

提交回复
热议问题