52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-10 17:42:11 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 media 2014-12-10 19:08 蝺刻摩
; L3 q* z! n- A" x7 Y% `" Y8 ]
) b, h7 j# U0 k' E1 L餈甫avascript閬蝒憭批嚗唬閬賢函⊥菜葫銝撖祇憿敺靘曉唬畾菟畾萇撘蝣潘嗥冽潮曉之銝阡*蝷箸澆臭葉憭桐蝵格撣豢具0 X/ v$ d) {6 Q4 A5 ^& ]# w
  1. <script type="text/javascript">
    & U8 q* `# R0 j: q0 @6 B3 [, d4 _
  2. <!--
    ; H+ B, G& }- K9 Q  S: j1 f
  3. ! ~$ P. S5 g( E2 H, }
  4. var viewportwidth;
    7 U6 n- E: o+ N0 ]
  5. var viewportheight;
    9 a: @9 h$ S$ [4 s) W. Z
  6. 3 q5 J2 J- @5 R0 c, r- l
  7. // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight+ g" x  V# G) ^, }7 d
  8. $ A/ I2 c4 |' a' X* Q/ p9 Z
  9. if (typeof window.innerWidth != 'undefined')& H$ j5 O) e3 g$ B! q3 R; Z+ R
  10. {
    % M0 y9 Q4 e5 x# m9 q7 W0 \2 H
  11.       viewportwidth = window.innerWidth,/ |/ a) g2 S  f6 x* s
  12.       viewportheight = window.innerHeight8 ]2 O, ^! l8 r2 M
  13. }$ |# ?& R8 _. J" Z4 D: v- p
  14. 8 r% ~# X+ W- r6 S( g; b
  15. // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)0 G" U- |6 P0 W; O; I7 V

  16. 4 n0 ^& N  Y( c: ^% F. S
  17. else if (typeof document.documentElement != 'undefined'
    - Y+ q, N& l$ x$ O- A6 s4 `
  18.      && typeof document.documentElement.clientWidth !=
    5 P( T7 `! a3 I" Q, q, x
  19.      'undefined' && document.documentElement.clientWidth != 0)
    / X- H) [4 i2 x. }0 r9 i5 Y
  20. {6 D, C- D# k5 I- Y3 b! e
  21.        viewportwidth = document.documentElement.clientWidth,! `# A$ g, c! A" k) S7 e0 I
  22.        viewportheight = document.documentElement.clientHeight
    ' t6 V7 `, g. t
  23. }  Y4 h, @7 Q3 r: A

  24. 9 J3 D& S& A# C
  25. // older versions of IE: {& g* R+ a  [9 _9 w

  26. 4 K( c" [3 }6 B$ L9 y8 n0 E" k4 f
  27. else
    " \" l9 d; Z% Q0 A% ?8 G4 y
  28. {
    9 c8 z" ^" x; Z9 f- i" \# u: i
  29.        viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    2 V- k" ^1 \# r9 J  A# z# B
  30.        viewportheight = document.getElementsByTagName('body')[0].clientHeight
    . T2 ~9 _7 C6 v- Z* Y  N
  31. }
    / l/ e. c9 K' `* E9 k0 N8 }
  32. document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');' z' m' W: p* `8 s* H
  33. //-->( a5 g) u( i( f8 C' Z" k
  34. </script>
銴鋆賭誨蝣
蝯: 狂oogle chrome 憿舐內蝯
6 G1 e* r2 D4 f3 }" B
1 w  X) @7 E. c8 d

* c+ [1 h, h3 H" n, s' `% k! c8 Z靘皞:
Get viewport size (width and height) with javascript

3 c: w/ R7 G" s  V
/ v1 A: f3 H9 W+ l4 T

4 g9 {* O) ]5 n, `3 ?

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-5-2 17:49 , Processed in 0.077477 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵