52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩 # d! V  c: @' _2 b- B+ z5 i

7 `5 x$ l7 Q, O餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具- v* Y+ v% ~) P( m4 N6 C
  1. <script type="text/javascript">
      ?, u) @2 X4 y# a
  2. <!--
    8 o  E% s! I7 u
  3. 2 g. ?5 A) e1 |( h8 q
  4. var viewportwidth;) A: e( y& p' t$ f; {- ]3 U9 h
  5. var viewportheight;5 `( ^& i6 A% a: g. a6 ^- D. D

  6. ! Y' [4 l, K- S
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    * n4 f7 S  W) V) @* Z

  8. - a8 x! [2 @1 Y( h1 j& d' J
  9. if (typeof window.innerWidth != 'undefined')
    % r/ o* e* f, E5 u; P8 @& M
  10. {; ?' X; J2 A: I4 G' F, i
  11.       viewportwidth = window.innerWidth,! g- t) z5 v4 f* W  d$ a: J2 P6 g; A
  12.       viewportheight = window.innerHeight8 D" C: B  M/ o1 X
  13. }
    , z* Y; t& `# T4 x1 h1 U

  14. 4 Z8 ?4 `$ g# u# L
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)4 S; W& E* ?$ U3 R1 E/ m( U( i
  16. 6 b$ H& y5 G. D5 o/ z! `. ^8 D
  17. else if (typeof document.documentElement != 'undefined'3 I+ }9 m) z+ ?6 n! B
  18.      && typeof document.documentElement.clientWidth !=6 g3 r" Z' v/ s# \5 V
  19.      'undefined' && document.documentElement.clientWidth != 0)0 s+ R# l$ E# L2 V8 m9 i' q- E
  20. {
    + l& q/ M( I. V; i4 n
  21.        viewportwidth = document.documentElement.clientWidth,
    + K# d1 }$ q, ^& Z* S6 D' U
  22.        viewportheight = document.documentElement.clientHeight& z' u/ _. Y) d' }, H. F) W
  23. }6 F/ n2 j4 V! H8 j9 R; I* m
  24. " g- K; I$ ]. e
  25. // older versions of IE
    2 e3 @) Y" X3 k, I% W: N, i
  26. 4 }8 d+ }0 G& c) H" d9 A/ R1 s
  27. else% D9 e: ^, |) L9 h# F
  28. {
    4 A( o* @1 X2 ]& d% Y
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
      ^# v$ y7 `+ k% W$ o
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    % [9 g5 r* e& |/ @$ q# d
  31. }+ C# X2 o1 S3 v  o
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    % g4 M5 o; s! W- u" b1 G
  33. //-->! Z- U# h$ R3 ^" |6 B( i
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯) {' [/ o  t* c1 X
" |4 ^: K8 B9 B9 s) R7 X
4 @, {" Z5 o* R5 Y7 w* ~4 b6 i( q% l  p
靘皞:
Get viewport size (width and height) with javascript

% {3 \; A" ^" |( D: K. P' t$ [
, ]7 i9 ]) w3 x! H; w; J' L2 j

' }6 [4 ~' c* F

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-27 23:42 , Processed in 0.069718 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵