52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
; @. u: E4 d! T6 _
5 o) J: h4 Z4 G1 S: @& \3 p餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具1 c" h) m5 G% O8 ~6 b6 ?* W
  1. <script type="text/javascript">
    9 V3 O, s: o) f
  2. <!--
      n# J) E# _/ Q! B& J0 U

  3. 8 j! `5 ~7 c$ P; R
  4. var viewportwidth;0 q' U  q: n) \$ t. H: Y& }, ?: E
  5. var viewportheight;! ^5 q2 `2 \* {/ [& l
  6. 7 U$ O) {) n0 `! ]1 R3 i
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    , ^4 h% M1 p( {2 s' ]/ B8 O! v

  8. ' Z8 D8 Q2 m+ G7 [4 f! L2 c
  9. if (typeof window.innerWidth != 'undefined')
    ! Z* c4 C, g! H8 E. J
  10. {
    ( t  X1 A2 t; O$ M5 u& a1 z
  11.       viewportwidth = window.innerWidth,
    6 `) Z# f' D: N
  12.       viewportheight = window.innerHeight5 z9 V- ]' g9 u* ~( o$ N
  13. }# o, k" P  |: \  \# _% R

  14. + X# ]% q  y1 r8 P
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)  x$ o7 r! u- g5 Y$ ~, w! [& }
  16. * t* }8 l3 Z# ~8 V: G
  17. else if (typeof document.documentElement != 'undefined'
    ) m- v: t2 p6 l3 H) Z7 U. I
  18.      && typeof document.documentElement.clientWidth !=
    0 O2 h! ]2 t7 K2 Z% J* a; b
  19.      'undefined' && document.documentElement.clientWidth != 0)
    . i- Z  b, B; ]. n
  20. {
    # s/ I1 Y3 e, [4 j
  21.        viewportwidth = document.documentElement.clientWidth,
    ; S/ C/ B$ |; f
  22.        viewportheight = document.documentElement.clientHeight. t6 s2 [5 S8 ^
  23. }
    7 n6 H& @$ B6 l, [7 W$ a
  24. # Z7 d7 t5 ~0 K7 C6 q2 k- N* J
  25. // older versions of IE  E- d7 D7 j5 N; o8 n2 W

  26. ! Y& k- e- ^' j! O, o9 N- J
  27. else9 K7 t" P. `. m9 ?7 ?
  28. {
    / _+ c/ O7 ]4 ?& x
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,! r% k: z+ b6 I: Q/ H! l
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight* y9 s! C8 a$ i, A0 w% z4 ?; q' S
  31. }  E/ z8 r! z. V3 y3 ^. \6 b
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
    8 @2 E1 l% Z0 I/ O$ `7 C. h  h
  33. //-->
    + \, \0 h" `+ V$ @1 a6 l3 t0 w
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯6 ?4 ^) J8 \! c

6 t. c" {, [* q% P* u

* E9 x+ b! u" ^' F1 l, d9 N. g靘皞:
Get viewport size (width and height) with javascript

1 l) n! X* X1 Y1 ?: D
8 b8 F* S) j, s2 O% z7 l
/ v' B% _( |% m( Z8 w* d

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-22 14:26 , Processed in 0.072933 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵