52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
0 ]: V* S+ Q! a; N7 i. p' A1 ^! @, f+ b
餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具
6 s- E5 F( R2 ]2 ^2 N- b- \
  1. <script type="text/javascript">
    4 {8 O" D) h' V. K$ _! b* W
  2. <!--7 x+ O( D$ G  a( O1 X

  3. 1 w& l+ x0 D1 L( j* f% M
  4. var viewportwidth;7 [& y! B; K* k$ h& x- S7 B( _8 L2 N
  5. var viewportheight;
    4 V5 w# v9 p" U6 ^5 P  h

  6. ( n8 V- K4 i5 B$ Q9 ^$ G
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    7 F* w1 z/ x1 P
  8. + r$ a4 b( i  E  }  k6 x
  9. if (typeof window.innerWidth != 'undefined')
    7 f- h( f' L- h, _3 V
  10. {
    . C. n3 g# K9 @0 F1 C
  11.       viewportwidth = window.innerWidth,
    3 M8 P* G1 B2 i+ U( z
  12.       viewportheight = window.innerHeight7 }# y5 a0 O9 d4 D+ Y( i$ J
  13. }) E1 X* m4 T  p7 r0 M8 l3 k# g

  14. , I( Y: Q3 ?0 x* |2 V. U; J3 @. u
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    ' ^, g% v4 Q* j* d  M# P! Y

  16. 8 O/ y7 f+ [% c# v5 Q7 x
  17. else if (typeof document.documentElement != 'undefined'
    ) T1 K5 s! C4 }
  18.      && typeof document.documentElement.clientWidth !=
    % w' z# n$ w0 t: M3 l+ {# I
  19.      'undefined' && document.documentElement.clientWidth != 0)# T/ ~  \. I6 d
  20. {
    . d- R; M; c* U6 R  P1 A8 e
  21.        viewportwidth = document.documentElement.clientWidth,
    & f& z0 f# k" Q( U3 G0 O4 {5 @
  22.        viewportheight = document.documentElement.clientHeight
    ! j7 @4 n+ g. I5 F' h: \
  23. }
    * D3 B$ Q, @! C( Y( T

  24. . p6 Q  i" A/ T, V
  25. // older versions of IE" z7 T, u0 M4 u' o8 o
  26.   d6 Z; [6 d! a6 s. o
  27. else
    $ D  K* ~# x- ?4 F3 x& j+ p
  28. {
    5 O/ s$ W, ~* y+ p) R
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    " N* W2 H* j+ ^& X0 W+ i
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    : y& y8 f  ?! r$ U/ u% E& f- I
  31. }! |; a) Q* K; D( t; E7 X
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    3 @: g+ E; ^; A, x+ O
  33. //-->- m, F4 ]8 x' D6 G0 S) z
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
5 `) K* a: s3 ?4 y9 ]6 r' }" ~9 k5 A 8 }* R) P. V: j  {# H$ ?
9 t# l2 f, s1 Z  i% @1 ?
靘皞:
Get viewport size (width and height) with javascript

" f9 [# S# w: L$ a* ?7 R! j. c. M
  l; T; V1 Q% y" z4 L: F
' J0 B/ f) B: i$ x$ C8 T

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-12-26 03:58 , Processed in 0.065808 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵