52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
0 @# E' c/ p; a) A
7 L3 n, \& l8 j3 F! |餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具2 t, r  Z5 ~2 X5 ~8 c& e* v2 s8 N. c
  1. <script type="text/javascript">
    / C4 a* X) y& u% {
  2. <!--
    ' q1 K; S* B5 g

  3. ( F: F; `3 Q! e2 r) c+ I% |- P, K1 e
  4. var viewportwidth;7 i9 z3 H" C3 P2 y
  5. var viewportheight;
    / f1 e" g6 d( r% L7 x( k* Z

  6.   Q1 y# F- k1 I4 p, ~" W
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    4 a' f, M; `* A4 }5 @4 d
  8. % X6 @6 T/ T. N- `6 ]* |
  9. if (typeof window.innerWidth != 'undefined')0 Z. Q$ U' _# z
  10. {
    3 x$ |* w7 a2 T8 t" F
  11.       viewportwidth = window.innerWidth,4 M1 W4 R/ P% L  U+ X( N5 ]
  12.       viewportheight = window.innerHeight  R" _6 _+ ~& T) K( u3 G
  13. }
      ?# o/ y$ x/ Z
  14. 0 H- ?( w9 c; R% f% r$ l4 S
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    6 z; b+ {. c7 ?# l. s0 o
  16. 8 E0 |* O% o! [) p1 D6 B: f8 p0 t
  17. else if (typeof document.documentElement != 'undefined'. ^- F- y' T: W$ H$ c
  18.      && typeof document.documentElement.clientWidth !=% ^. v! \( N4 b' q8 I3 a% R
  19.      'undefined' && document.documentElement.clientWidth != 0), y) N3 c8 P3 u8 w/ d, f( E
  20. {
    9 e8 I# U9 f4 n# x% H6 ~
  21.        viewportwidth = document.documentElement.clientWidth,
    4 e4 ^: b2 r3 |% C5 A; }4 t
  22.        viewportheight = document.documentElement.clientHeight) k2 ?' Y/ A2 s& v0 s+ s% N' T
  23. }
    * E! x  w! q8 s  c, t7 I

  24. 2 W" G. p! f0 Y7 z
  25. // older versions of IE+ ]) w$ d4 l+ ^5 X5 l
  26. % z. K: v6 \' O7 G. c' m1 r
  27. else
    + B8 b% a' ]; b+ i  Z. g
  28. {# {9 `0 `2 _+ U1 b0 z" `7 |
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth," J$ h1 {: Y, A6 h5 s7 l6 \0 E& p
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    & n, Z) U# S) H" ?: \
  31. }$ u4 ]. o) c% l# X# t6 ^
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    + t% G5 h$ n0 g; m, N3 b
  33. //-->( [2 R2 d$ @1 `# [6 X! Y, T1 c* m
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
7 p6 ^6 N' r6 W- {3 Z1 D
9 L. x9 C3 H$ a( R

( f" ^7 Y# }1 V( a靘皞:
Get viewport size (width and height) with javascript
" {/ j  g; P' B& M' ~

+ T3 X, a" O; \) _0 s4 h; P

# l: z) P9 I( Y5 t2 r) _

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-30 23:58 , Processed in 0.063814 second(s), 18 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵