js焦点图特效源码下载,焦点图点击切换,自动切换,免费下载
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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | <!DOCTYPE HTML> <html> <head> <title>please enter your title</title> <meta charset="utf-8"> <meta name="Author" content="js焦点图特效源码下载"> <style type='text/css'> *{ margin:0; padding:0;} li{ list-style:none; } #banner{ width:730px; height:454px; margin:50px auto; position:relative; } #banner .pic{ width:100%; height:100%; position:relative; } #banner .pic ul li{ position:absolute; display:none; } #banner .tab{ width:148px; height:20px; position:absolute; bottom:10px; left:50%; margin-left:-70px; } #banner .tab ul li{ width:18px; height:18px; background:#666; border-radius:100%; float:left; margin:1px 3px; color:#fff; text-align:center; line-height:18px; font-family:'Microsoft yahei'; font-size:12px; cursor:pointer; } #banner .tab ul li.on{ background:#f60; } #banner .btn{ display:none; } #banner .btn div{ width:30px; height:60px; background:rgba(0,0,0,0.3); text-align:center; line-height:60px; color:#fff; font-size:24px; position:absolute; top:50%; margin-top:-30px; cursor:pointer; } #leftBtn{ left:0; } #rightBtn{ right:0; } </style> </head> <body> <div id="banner"> <div class="pic"> <ul> <li style="display:block;"><a href=""><img src="img/1.jpg" /></a></li> <li><a href=""><img src="img/2.jpg" /></a></li> <li><a href=""><img src="img/3.jpg" /></a></li> <li><a href=""><img src="img/4.jpg" /></a></li> <li><a href=""><img src="img/5.jpg" /></a></li> <li><a href=""><img src="img/6.jpg" /></a></li> </ul> </div> <div class="tab"> <ul> <li class="on">1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li> </ul> </div> <div class="btn"> <div id="leftBtn"><</div> <div id="rightBtn">></div> </div> </div> <script type="text/javascript" src="js/jquery-1.12.1.min.js"></script> <script type="text/javascript"> $(function(){ var $tabLi = $('#banner .tab li'); var $picLi = $('#banner .pic li'); var $btn = $('#banner .btn'); var $btnDiv = $('#banner .btn div'); var $banner = $('#banner'); var index = 0; var timer; $tabLi.hover(function(){ index = $(this).index(); fn(); }); $banner.hover(function(){ $btn.show(); clearInterval(timer); },function(){ $btn.hide(); auto(); }); $btnDiv.click(function(){ var i = $(this).index(); if ( i ) { index ++; index %= $tabLi.length; } else { index --; if(index<0)index = $tabLi.length-1; } fn(); }).mousedown(function(){ return false; }); auto(); function auto(){ timer = setInterval(function(){ index ++; index %= $tabLi.length; fn(); },5000); } function fn(){ $tabLi.eq(index).addClass('on').siblings().removeClass('on'); $picLi.eq(index).stop(true).fadeIn().siblings().stop(true).fadeOut(); } }); </script> </body> </html> |
js焦点图特效截取的图片如下:

网友评论:
js焦点图特效源码已经下载了,很好用。
博主讲的很用心,过程也比较详细,对我很有帮助,非常感谢。
嗯嗯,感谢,这个代码对我很有帮助。
不错,已经转发了,这个需要自己引入jquery,总体上还是可以的。
7