萬盛學電腦網

 萬盛學電腦網 >> 腳本專題 >> javascript >> javascript+html5實現仿flash滾動播放圖片的方法

javascript+html5實現仿flash滾動播放圖片的方法

  javascript+html5實現仿flash滾動播放圖片的方法

       本文實例講述了javascript+html5實現仿flash滾動播放圖片的方法。分享給大家供大家參考。具體如下:

  html部分:

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script src="move.js" type="text/javascript"></script> <link href="css.css" type="text/css" rel="stylesheet"> </head> <body> <div id="playImages" class="play"> <ul class="big_pic"> <div class="prev"></div> <div class="next"></div> <a class="mark_left" href="javascript:;"></a> <a class="mark_right" href="javascript:;"></a> <li style="z-index: 1"><img src="image/1.JPG"></li> <li><img src="image/2.JPG"></li> <li><img src="image/3.JPG"></li> <li><img src="image/4.JPG"></li> <li><img src="image/5.JPG"></li> <li><img src="image/6.JPG"></li> </ul> <div class="small_pic"> <ul> <li><img src="image/1.JPG"></li> <li><img src="image/2.JPG"></li> <li><img src="image/3.JPG"></li> <li><img src="image/4.JPG"></li> <li><img src="image/5.JPG"></li> <li><img src="image/6.JPG"></li> </ul> </div> </div> </body> </html>

  css部分:

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 body{ margin: 0px; padding: 0px; } ul{ margin: 0px; padding: 0px; } li{ list-style: none; } .play{ width: 600px; height: 550px; left: 30px; top: 20px; position: relative; border: 2px solid black; } .big_pic{ width: 600px; height: 400px; position: relative; background: snow; overflow: hidden; } .big_pic li{ width: 600px; height: 400px; overflow:hidden; position: absolute; background: black; z-index: 0 } .big_pic li img{ width: 600px; height: 400px; position: absolute; } .mark_left{ width: 300px; height: 400px; background: orange; position: absolute; left: 0px; top: 0px; z-index: 3000; filter: alpha(opacity:0); opacity: 0; } .mark_right{ width: 300px; height: 400px; background: cornflowerblue; position: absolute; left: 300px; top: 0px; z-index: 3000; filter: alpha(opacity:0); opacity: 0; } .prev{ width: 60px; height: 60px; background: url(image/btn.gif) no-repeat; position: absolute; z-index: 3001; top: 170px; left: 10px; cursor: pointer; filter: alpha(opacity:0); opacity: 0; } .next{ width: 60px; height: 60px; background: url(image/btn.gif) no-repeat 0 -60px; position: absolute; z-index: 3001; top: 170px; right: 10px; cursor: pointer; filter: alpha(opacity:0); opacity: 0; } .small_pic{ width: 594px; height: 144px; position: relative;top: 0;left: 0; border: 3px solid paleturquoise;overflow: hidden; } .small_pic ul{ width: 594px; height: 144px; position: absolute; left: 0px;top: 0px; } .small_pic li img{ width: 194px; height: 140px; } .small_pic ul li{ border:2px solid paleturquoise; width: 194px; height: 140px; float: left; cursor: pointer; filter: alpha(opacity:60); opacity: 0.6; }

  JS部分:

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
copyright © 萬盛學電腦網 all rights reserved