52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩 ) g$ Y; S5 z: k! ^" ^7 S; p4 `
1 y; e; m+ y. `$ J% z/ x
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具0 P1 [+ e% A) v2 _* p) \) O- Q* K, y
  1. <script type="text/javascript">
    # Y: w  c& U2 A$ e1 H: @
  2. <!--4 }5 R* m. m6 T8 Z) {6 M

  3. : ]4 M# T1 s3 a, J% k
  4. var viewportwidth;: [8 K* q' n! s' Z* F/ D
  5. var viewportheight;$ V. B- M5 z1 P9 {. A/ k& z' K# }

  6. ) X" k$ G6 Z) i7 d( u* [8 T
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    1 i# Q6 ~2 [; B, {: W3 f

  8. ! O! N% p7 n$ I5 U8 b( Q# y1 c# u. j
  9. if (typeof window.innerWidth != 'undefined')
    2 H+ V1 n2 a8 G) B$ ?
  10. {
    ! m) a: ]0 ?# z" G) |
  11.       viewportwidth = window.innerWidth,
    $ U2 D( j. j  ]8 U
  12.       viewportheight = window.innerHeight1 o$ l0 ?# ~$ p' b
  13. }( G: u* ?7 v3 r0 y, Z

  14. 6 x9 V" A/ {- G
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)/ X' \, s  Z$ A, d2 F: ^! v

  16. ; d/ h0 L( Q" ?# M
  17. else if (typeof document.documentElement != 'undefined'1 j* K. K* T5 n1 k5 W( U# |
  18.      && typeof document.documentElement.clientWidth !=- U; S( X; n% d( P$ X1 ~* w* ]- v
  19.      'undefined' && document.documentElement.clientWidth != 0)+ `* [6 t8 Q' G. p
  20. {% S0 q9 i; t. `8 W0 a+ x
  21.        viewportwidth = document.documentElement.clientWidth,
    : H9 f9 F3 U, f+ x  ?& e
  22.        viewportheight = document.documentElement.clientHeight, f& S; F. v; ?- g( g- j$ O" b
  23. }8 ]0 O  C/ z4 h' N( A
  24. ( v1 y  F2 Q2 m
  25. // older versions of IE/ J# ~( w6 T/ m% X8 N
  26. , V2 M6 T5 r/ e4 m
  27. else
    % b5 W# `  f1 ?$ F) L. g# f
  28. {
    , Q. b, R& s& }* ?" p  k
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    6 s9 p  c9 d7 @( y9 [
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    1 B9 r9 C3 S- `; J" Y
  31. }; c$ _* H, [, X/ c
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    ( r+ t' k  f, M1 c8 v+ Y6 I, Z
  33. //-->8 V) C/ i/ z7 Q; m" ]
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
: f2 B7 i  W1 F2 C( @   ]. l6 ~8 R; N* m' v$ U# _

2 B. b+ R" w- m! p靘皞:
Get viewport size (width and height) with javascript
+ S/ q% o5 m/ C9 B

* Y4 U- B# {3 D4 [

. F: B+ F6 P$ w1 Y0 {5 X

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-19 07:46 , Processed in 0.065335 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵