52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |甇摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
$ }, I) n0 }; T7 V" z+ H+ ^& R& `- i% \! a9 a1 l. `! d3 I
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具# F) p* w' O- g4 ^2 o9 ^! q
  1. <script type="text/javascript">( D; ]# y) S5 [2 L4 Z' ^
  2. <!--4 t) ?" ], h2 [4 ~/ [* S8 F! d0 E

  3. 7 r8 j1 C) J2 B! S  \+ P
  4. var viewportwidth;: V4 l4 h0 n* m, t
  5. var viewportheight;
    " T- @  g% `. Y5 F' I+ }

  6. ( }& O$ s( z" ^) x9 \; F, W; P1 n
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    9 h! _& S# X; w: _$ ]4 G/ T# Y
  8. 7 I; K# a4 x* [# E
  9. if (typeof window.innerWidth != 'undefined')
    9 W3 [" p& @% b! W' _
  10. {& Y' ^! t& U6 n( J0 }) O
  11.       viewportwidth = window.innerWidth,9 Q6 C. v7 n. Q$ t
  12.       viewportheight = window.innerHeight
    1 M+ N$ _+ `5 K/ L$ n0 A& d
  13. }
    . u/ p+ G1 g+ U4 p0 h1 k7 G
  14. 1 a1 S  G$ T* v/ K8 [4 B$ l' W: b
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)" J% N# H7 n2 q- v$ p# M; [0 [

  16. % q7 x5 b. m( j$ O  c) V" [
  17. else if (typeof document.documentElement != 'undefined'+ Q. W" M- w5 m: n; A
  18.      && typeof document.documentElement.clientWidth !=
    % U& g3 P! Z5 J! T/ L) m  i
  19.      'undefined' && document.documentElement.clientWidth != 0)' |. T2 ?. V, ^  g$ {/ m
  20. {! I/ |% {) l' l3 [" V3 @+ x0 J
  21.        viewportwidth = document.documentElement.clientWidth,/ Y/ g4 n" n+ h1 o4 m1 J! j% V
  22.        viewportheight = document.documentElement.clientHeight" `7 P) y# R6 D% h% D
  23. }/ f) t- W8 H; j8 i9 O% _

  24. : Y& j; B* g" `; P: L0 x4 `
  25. // older versions of IE
    % D. c9 |0 A# p7 Q* v5 _! o

  26. & `+ b$ C. n; G/ E6 R$ _1 Y
  27. else1 [, g* \. F- J$ ~6 L9 n0 I/ n
  28. {8 N7 V# O% N! V0 N) ]# ]5 n. V
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,' e" k3 F/ Z1 e& ~4 H; P* I
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight" P; r' J  J' r. o
  31. }) J! ?' v* {7 F
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');0 ~" P- O' _0 f
  33. //-->, N  u9 j7 y# O+ a) V* U+ ^
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
  K6 w( o$ I/ |- Q+ h/ n4 \
8 F% R/ x+ ?, H0 e$ r6 A

" g* D* r0 V+ R- b靘皞:
Get viewport size (width and height) with javascript

9 w6 r5 P! {" Y
: b2 o$ P7 J3 S9 W* v

: Q4 E3 j$ K) }, Z

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-19 15:09 , Processed in 0.081836 second(s), 20 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵