52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩   n% u$ R* a* K% X7 e0 \

. p! P$ U+ Q" T: c餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具
: x3 H- u0 r9 [0 X+ V7 `; o
  1. <script type="text/javascript">( t1 x) `$ ]9 S  ^. M
  2. <!--' s4 Y  p9 \" a1 _$ O* B* o
  3. 4 P3 T7 w, v: W9 x" K7 c8 C" E
  4. var viewportwidth;
    : L' w: Z1 V. a% |/ p
  5. var viewportheight;
    ' n% \/ O! ]; y& U! @& ?+ z

  6. 7 [. m0 l3 D/ C6 C
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    ! f' g& p8 A; S
  8. - p' a& j1 a' l( x* c
  9. if (typeof window.innerWidth != 'undefined')- A' I& D  R. C* }6 K: T" `- g. @
  10. {
    ) ?! d  M. }" \+ z3 J& U! S
  11.       viewportwidth = window.innerWidth,+ }& R, \2 U; S) ]% J5 H
  12.       viewportheight = window.innerHeight: n) k/ g5 \' z0 I
  13. }
    / T/ h4 x& o% i4 [' L2 X6 t0 V
  14. & n/ V7 |, [# F# r
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)& Z- j+ _' w! L7 r, a% }

  16. & R" B0 Y. k' j1 z3 A1 [
  17. else if (typeof document.documentElement != 'undefined'1 G; S: z! q8 W
  18.      && typeof document.documentElement.clientWidth !=( d: H  I/ G, L. M% o, o
  19.      'undefined' && document.documentElement.clientWidth != 0)
    . H- u8 e+ ~8 S( {4 m- P' @& A6 m
  20. {
    ! i4 n2 f% j" e
  21.        viewportwidth = document.documentElement.clientWidth,7 H( w+ U2 o" {1 q2 k9 \
  22.        viewportheight = document.documentElement.clientHeight
    ; t" g" _3 W  R; h
  23. }
    / N* a/ W5 [; v* `3 B: I
  24. 5 m4 J/ j1 m; `4 d& A7 O. r% D. K0 G
  25. // older versions of IE4 J9 K; t1 c( I: l& b4 R
  26. , ]6 S/ O: A+ l1 ?+ C8 _3 C
  27. else- o# z8 Y) }$ g
  28. {( @" Q/ b: Y# _) c( v
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,3 ^" @* ^8 F- q( d
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    & [, |) P0 a5 ~$ z. B
  31. }
    8 }1 p: s6 n/ Y3 X3 u( P
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');- f/ U/ c1 o. C4 l' ~
  33. //-->- c$ u  |( v- G- t/ I4 D" P& O- z
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯6 o4 f* M) W6 X2 f

& r1 ^7 K! W" l( K- u

5 b- m9 q* {+ l. p靘皞:
Get viewport size (width and height) with javascript
; O  N* H$ Y, G: D
; r- w& S2 T( i
( D$ f2 r) c/ n: g

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

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

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵