52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |甇摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩 % }8 O- S2 K, l8 v( P- t5 A, a7 M

, b% L2 h) J: y, g3 n! h餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具
% x" \5 J- F" v/ j5 g
  1. <script type="text/javascript">
    ' d- h7 h# @1 f; @1 F% i7 \
  2. <!--
    & \, l( U" w* O5 R6 w3 a6 h9 J: ?

  3. 7 ~% t9 ^9 q- ~1 b3 @1 @! M: o9 E; m
  4. var viewportwidth;
    $ G# X* K3 d- B! X5 P
  5. var viewportheight;
    7 Y! |; ^  _5 l* |% S
  6. 3 P% _1 U. V/ E: \
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
      d& ]4 ?, a3 z4 n8 B
  8. 2 t5 z5 Z- o4 a9 E9 g8 F
  9. if (typeof window.innerWidth != 'undefined')
      z0 R- n2 k" q! b" b- O1 H( b
  10. {. z1 h( e5 B" U, E; B  g
  11.       viewportwidth = window.innerWidth,* i* C7 H2 o" @7 ~5 b4 D4 i7 F
  12.       viewportheight = window.innerHeight
    ) [; q- B3 [( N' T- k4 _
  13. }
    ) k. e4 ]% |0 ~/ @3 E+ ^

  14. 5 \3 E% b+ u, ?$ D
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)5 v. C- ^* f! }* P
  16. # X% x  u* S* R
  17. else if (typeof document.documentElement != 'undefined'' m/ ~- W$ N- N- n' l
  18.      && typeof document.documentElement.clientWidth !=
    , w( T$ h% `& A0 r# R% c% J0 F
  19.      'undefined' && document.documentElement.clientWidth != 0)9 |$ \, E0 Z7 }" a0 H
  20. {* B0 E0 V, S6 V: S$ P1 |
  21.        viewportwidth = document.documentElement.clientWidth,
    , {. F4 W( g8 J$ B" F' Y
  22.        viewportheight = document.documentElement.clientHeight3 K3 S% s! X1 Z# r4 L
  23. }) P5 z% Y1 w5 V" J0 w- i7 i
  24. 7 @2 j$ n# N9 P/ m7 b4 u
  25. // older versions of IE2 l( n& ^) i6 f6 d
  26. 9 K( F* S& z! [+ X, N
  27. else
    % t" v8 g# L: |
  28. {" M8 n) Y* S9 X3 h7 P# [/ b' X. k
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    ; n$ L. s; n3 H" |' ?7 R4 v
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    : c% }' \) O3 Z
  31. }. E& ]+ `0 L9 V, P% ~( X
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');& Y8 b6 q7 F6 g! }7 w1 t7 f9 x- N
  33. //-->
    3 _% p2 @# R+ ^4 O7 v2 `9 u* _
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯3 x5 M* o! H% s8 z

# z- U- M7 e4 q" q

4 t2 I' ]- i) s( J8 v靘皞:
Get viewport size (width and height) with javascript

- \: w7 W* K& ?' `# s/ y7 q  D! b9 a% c: s9 S, r9 X
  @' s) V) I3 O" Y. C4 P: L% x

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-22 14:57 , Processed in 0.068475 second(s), 20 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵