52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
& u! s  W1 B: @! a7 W- D8 l! T; H% I& Y$ ~0 ?
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具
/ ^: q' R+ c. u3 ~! f" z( z
  1. <script type="text/javascript">
    & P! k7 F9 q8 i! [3 K7 J5 E
  2. <!--) Y0 J2 t1 C  O9 X: X
  3. $ F$ ]( ], O; i& d% q0 S( B
  4. var viewportwidth;
    . K* m  y; A9 ]. Z- S/ q
  5. var viewportheight;9 D) T$ c2 |" w2 Q5 e4 v" `" X- Z
  6. 0 n2 S' Y( B8 H) q, \2 _' @6 I" _
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight2 N, Q/ D/ [, J) \
  8. 6 J  o+ x+ p. Z1 g
  9. if (typeof window.innerWidth != 'undefined')7 u+ }4 s* H; [9 W
  10. {
    + b9 ?' f' Y4 c
  11.       viewportwidth = window.innerWidth,
    7 y8 g2 v. \; F: Z) S( N
  12.       viewportheight = window.innerHeight
    6 d5 H/ T) B+ t7 J  ~
  13. }
    4 }* w% d- u, E9 m

  14. 3 G# H, v0 q$ |/ ]
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    3 H0 j- Q; R/ G% o

  16. 0 O4 {" V. x; i/ O' c3 v9 w
  17. else if (typeof document.documentElement != 'undefined'
    + e* H  \7 v' o! q
  18.      && typeof document.documentElement.clientWidth !=6 K* a( K9 y- ^7 |
  19.      'undefined' && document.documentElement.clientWidth != 0)
    : I8 ?# Q, A7 q- k/ \1 T7 O
  20. {
    - Q6 R9 P# m/ A, f$ }
  21.        viewportwidth = document.documentElement.clientWidth,
    9 ~$ l2 k2 Z! {/ [! ~
  22.        viewportheight = document.documentElement.clientHeight; d& N" Z1 ~1 Q/ ?- L* {
  23. }
    ! B! t/ _4 {# Q" C1 `
  24. . `2 s$ x* w  Z4 a
  25. // older versions of IE4 a/ u2 [" w) A0 {
  26. 1 |& j" X2 G9 E+ w
  27. else" w/ i; G( F0 o# Q
  28. {, h1 E# p- \# N/ E
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    8 M0 m# {% t+ n" X( e! a" k1 ]: [
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    6 l! ^: b7 W9 S
  31. }" k: h, ]3 s! }
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');# r, J1 V  y5 j4 q% K  ~
  33. //-->
    * ]! J! }" a8 z/ w
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯, q* D' V: @. H" p0 V; i

; Z  }! f: u# n& }  Y* m$ @& g& R- X

3 C- i0 S& t4 D' ^靘皞:
Get viewport size (width and height) with javascript

% Q% r" V, k; ^( A7 j9 i: `+ d! v9 V' B2 h. M
/ J. s: c/ w- q0 U2 @5 F& r6 J

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-4-5 05:34 , Processed in 0.072675 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵