52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩 0 K" i( Y, |, d- t& {. N
* ~/ R& E8 P/ {, p  \) `( Z  h
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具! R' g0 E7 j# \1 ]6 @$ d
  1. <script type="text/javascript">
    7 l! v  g& B6 r$ m, G7 y1 _
  2. <!--
    . R' n# l1 W) u" q4 h
  3. + E4 r; {* a2 {- b
  4. var viewportwidth;
    8 r& o' b( W2 y+ `
  5. var viewportheight;
    " P# U3 G8 \5 W6 `. }& \! s

  6. % B: n1 e8 x; x3 O+ s" Q  x- Q. _
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    " [7 A' t' r( q
  8. 4 a/ M5 t' D* ?0 ~
  9. if (typeof window.innerWidth != 'undefined')
    * X% k2 x- x% b# F9 D
  10. {! I8 H' Z' K" b" Z3 G! C- F
  11.       viewportwidth = window.innerWidth,+ @; }1 o" e4 U! s8 s$ L( ^
  12.       viewportheight = window.innerHeight
    " L; J2 B' E0 U) l, m; r5 _
  13. }
    ) ?5 X1 P9 U" `# O8 M

  14. + T8 o! S: P6 c1 z; ^
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)- J7 r9 e3 V1 s1 L

  16. % }9 r# H1 r, y) C/ J7 A
  17. else if (typeof document.documentElement != 'undefined', D5 e& l1 s# f! w  G$ ]) y
  18.      && typeof document.documentElement.clientWidth !=
    5 E5 r, X) |  G- w4 m$ }' ^" N
  19.      'undefined' && document.documentElement.clientWidth != 0)* F( c2 T! b6 q; c9 k" k
  20. {& o" k2 I& E, S
  21.        viewportwidth = document.documentElement.clientWidth,! N* h& U" b! \( K6 F
  22.        viewportheight = document.documentElement.clientHeight6 G, D$ c0 k5 I. P7 F6 R$ R
  23. }7 [- `0 Z5 x( b$ ^. f
  24. 2 r& K1 B9 X  e  e
  25. // older versions of IE# |- `0 T5 z1 m! J3 H" N. `& f

  26. * @5 |8 j" D; w, p' C$ {/ y6 A
  27. else  I  s* J0 u) ^$ ]  l3 B; L" G& a
  28. {" \' I/ r$ J0 L  m2 s& x  F
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    - x9 D) ^( ^9 o) n$ K
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight* e# q% G4 U2 U( R$ X; R
  31. }
    $ K( y% o: c0 h6 X
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    8 C' ]3 h/ g2 _! X
  33. //-->
    5 B  Z: r* _4 p, s3 d
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
8 B3 ^! ?4 `6 U: Z9 Y 7 n7 I6 @; w) l. e" \# \4 J. ^/ K$ {
& X, X3 ?- e/ t" }) i
靘皞:
Get viewport size (width and height) with javascript
% d/ Q1 q7 b4 X( ?
  t6 b6 W% O5 ?
. B& J8 G9 U! e$ b. X8 v

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-20 07:53 , Processed in 0.081194 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵