52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
% O2 p- g2 k/ p+ S3 m1 q% J1 P8 R) I- G/ a$ @% X6 E
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具
1 u7 l6 ^0 Y* E& K0 T  s9 w+ \
  1. <script type="text/javascript">
    5 O: v1 F/ _, p3 ~2 J5 a
  2. <!--7 {- w& `1 d6 u: [) [

  3. 6 r# k$ Y% a; ]4 U3 ]3 S
  4. var viewportwidth;: F: H) L6 s$ N/ a% z1 p
  5. var viewportheight;
    8 r& \; t) l6 M7 ?) i$ T6 G
  6. . Z, S7 U; @) u& N
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    4 j4 r4 Z! D3 |/ I* i1 ?5 i3 _; d

  8. 0 Q/ B( p% K/ S2 B
  9. if (typeof window.innerWidth != 'undefined')& q7 J9 ]% ^* h3 I( U1 @5 U) t0 a+ |# ]
  10. {
    1 y! X! Y" [/ \1 O3 S
  11.       viewportwidth = window.innerWidth,
    1 k  \+ Y4 [& d) B4 n
  12.       viewportheight = window.innerHeight& x1 L/ I% {4 W& Y% C
  13. }# w5 c: M9 H! \

  14. . ^, ?+ _  L9 s6 W/ @
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    4 F4 D; [, {1 y6 k- d) S
  16. * h9 f- y# i5 z8 h( b! p1 u
  17. else if (typeof document.documentElement != 'undefined'7 P. T/ F" V4 Y5 j
  18.      && typeof document.documentElement.clientWidth !=
    * L: t, L) O+ a9 |" K( m0 R! ]
  19.      'undefined' && document.documentElement.clientWidth != 0)$ ^; _( X2 t. E7 e  @9 a
  20. {
    / B: A5 `8 z+ T8 Y
  21.        viewportwidth = document.documentElement.clientWidth,$ C1 ~8 {# w' k  Y+ D
  22.        viewportheight = document.documentElement.clientHeight
    , s7 S8 h& r- c
  23. }
    $ E  x6 _& }8 o  N
  24. & k; m+ j* ~3 ^3 r
  25. // older versions of IE
    1 y) X7 e3 c- \

  26. # t8 x5 s7 ]5 X% d9 N( U7 z; c
  27. else
    ! Y+ v/ u; e. k  K- r$ Y) ?
  28. {. c, U+ {- ~6 S* \
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    9 V% ^8 h0 F+ v% Z& p2 P9 G3 a
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight, G! e5 M5 e/ P% z1 }
  31. }1 I; H- L/ N+ Z$ P! P3 r% C
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');+ b, l$ P' R; B! d9 b, f
  33. //-->& @2 k( T+ a: F
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯8 U' |* t$ ^' t

: N& W5 E1 ~1 [4 B) T. [

7 d( @. D# _6 J$ Z' w! n靘皞:
Get viewport size (width and height) with javascript
$ K# E% S$ O+ w: @9 r5 [

: m, \( l  p4 D, u

3 W" |0 X- j1 \$ i& ?" F

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-30 23:58 , Processed in 0.068746 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵