52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4736|敺: 0
銝銝銝駁 銝銝銝駁

[HTML] 敺桀航閬蝒批捆撠箏站--Javascript[1撘萄]

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
; V. E1 Q& C7 J9 \& @  d
  M0 W, B# |5 y' E0 {2 B' P餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具' f. c6 U9 V  z: S: @+ f4 l
  1. <script type="text/javascript">7 g5 d. m8 F( h; A
  2. <!--' K3 _7 F) C: _$ E/ l0 R
  3. 8 O* K, G6 C9 d4 w5 o* b5 o
  4. var viewportwidth;# ]4 j. s; P1 `
  5. var viewportheight;* W  w. ?. q+ Z) w3 Q. a1 m; ]

  6. 0 w$ {  f) d" k6 G9 l1 r) a
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    ! [" I: I* ^- W  u+ m* x8 f
  8. # g1 ?9 ]& a. n% B9 q
  9. if (typeof window.innerWidth != 'undefined')
    6 f! |* d0 W- l2 \: s) d% W- M
  10. {
    1 n4 F, ]) l  b# D7 N9 q# g" P! w" U
  11.       viewportwidth = window.innerWidth,
    1 }0 R$ J- O5 J
  12.       viewportheight = window.innerHeight2 ^: U, n& C+ ?' @6 G
  13. }
    ! _1 Y/ i0 U. m, k' c: g( O

  14. % S. _: N) A6 y2 D
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)  l9 k3 j. q8 c" g+ `2 ?
  16. 1 ]5 U9 M* D# Y
  17. else if (typeof document.documentElement != 'undefined'
    4 Z7 h- m( j+ `! g
  18.      && typeof document.documentElement.clientWidth !=
    ! E) u6 G/ E( ?( ?4 n5 Q
  19.      'undefined' && document.documentElement.clientWidth != 0)8 u( v, w  `( q% m( A& J0 A8 E' V
  20. {
    / d* Z1 ^, i8 g3 b% E( ]
  21.        viewportwidth = document.documentElement.clientWidth,7 X- U8 F, F# o* O/ }  `- w( {
  22.        viewportheight = document.documentElement.clientHeight
    % p- X, m1 a4 R7 q7 B0 W
  23. }
    ; G0 J5 y2 [: ^% Z& k4 r. O

  24. - c- F4 D( z5 U, j
  25. // older versions of IE6 |, t* h; G/ ?2 e6 D% s

  26. % z5 N) \+ O+ N% l) q+ V
  27. else0 q+ @3 w, O0 Y5 S% P6 z1 P
  28. {: Q1 ~/ {- p% u3 J
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    7 W- @3 W4 d5 y8 }
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight( r, a) Y" q4 Z7 k0 P. v% ~% L7 e
  31. }1 }/ v) p8 E( X8 j) Z3 H( |
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');3 U; ?3 E1 [; \+ ^. g
  33. //-->+ f. ?7 J; W+ G0 o
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
+ A9 g  T  f" D! T& f5 x0 K+ r 9 L6 l) m& o1 o8 u$ I( e; ], u

0 n4 Y0 ~+ I! v" y& j靘皞:
Get viewport size (width and height) with javascript
/ I8 J. z* x" W" z& C' ?9 E6 V1 |
: C. i+ M* y, W9 F

2 D) H/ M) D6 M) S

雿輻券

祉蝛閬

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-25 17:11 , Processed in 0.068847 second(s), 19 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵