52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
- L2 t) |% t8 a( C3 \7 v  c& ^7 H/ u& V. M- e& ]3 i7 ?' r5 O' S8 B! J
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具" K$ O( s, t: J8 U9 L
  1. <script type="text/javascript">
    0 _" X; |6 a# f+ w0 _
  2. <!--5 J( |1 ^/ B  f' Q( O* x$ h
  3. 0 g1 M( g9 f' q7 i6 N; M/ x4 f
  4. var viewportwidth;
    * K- [8 `+ h) y  _# l5 ^. _9 @
  5. var viewportheight;2 m. @" w$ d6 m, A% ~: [4 t5 V
  6. 6 }- V+ w( ~/ F" W9 B, S$ d: M
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight+ \4 B9 I/ M% Q( ], C
  8. 6 A4 B' [) j2 h+ g" H9 _1 ]
  9. if (typeof window.innerWidth != 'undefined')
    + i" O/ K: M$ o. I$ g5 k
  10. {
    & c! [% x. }$ a7 [$ c, U' G! k) v
  11.       viewportwidth = window.innerWidth,5 I/ |; O: ^- L7 ~' S$ O7 x
  12.       viewportheight = window.innerHeight
    6 W& Q7 @7 z$ F; ~7 q) D
  13. }
    4 r2 |! F6 Z; _% H1 O9 _; O

  14. ) i: f# Q# L. D. I, ~, S
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)- Z# R; ], B  z! B
  16. & u; a  c' e2 O' i1 q6 d
  17. else if (typeof document.documentElement != 'undefined'0 ^! G, @- N' Z, Z
  18.      && typeof document.documentElement.clientWidth !=/ f% V/ k6 |/ t3 {
  19.      'undefined' && document.documentElement.clientWidth != 0)$ l% M4 t3 S* H' }  e9 v5 A0 ^
  20. {$ E$ _$ _7 l/ J$ s$ p' J
  21.        viewportwidth = document.documentElement.clientWidth,
    ( ]  }0 W  [: R/ n
  22.        viewportheight = document.documentElement.clientHeight+ W: r& [5 l6 c$ p' |
  23. }
    % A& D  F) ?" d8 f, p' {
  24. , _1 n7 Y2 h5 @+ _8 b! g
  25. // older versions of IE# q; }! p: A+ M( @5 w0 w# d
  26. $ @2 C' k  ~. v8 H( s$ |
  27. else# B- e6 a- ]5 v& _- V
  28. {0 {6 i- [) I+ U+ _' A3 |
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,# F& P/ r% [3 _4 s+ ~
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    ( x  L" e0 K0 `! C& {
  31. }
    ' u- H# ?' L; H4 @) N
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    0 L0 e1 i6 ]6 F8 e, n* a
  33. //-->
    + ?" {0 E6 n! h, R  d
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯) E7 }" M% C' l' g7 j7 z

6 f; |! N; P, K" s7 Z
; }3 T5 I5 Y" B
靘皞:
Get viewport size (width and height) with javascript

  `$ |; p$ F' L  t7 U$ v  q3 A% E  @3 g4 O  ^+ ~1 R& u
8 b2 U6 t1 ^# v: j

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-28 05:22 , Processed in 0.077794 second(s), 19 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵