自适应焦点图插件hiSlider 支持触控
XML/HTML Code
- <h2>example3: 支持触摸事件 + 弹性布局 (请在移动端测试)</h2>
- <ul class="hiSlider hiSlider3">
- <li class="hiSlider-item"><img src="images/1.jpg" alt="11111"></li>
- <li class="hiSlider-item"><img src="images/2.jpg" alt="22222"></li>
- <li class="hiSlider-item"><img src="images/3.jpg" alt="33333"></li>
- <li class="hiSlider-item"><img src="images/4.jpg" alt="44444"></li>
- <li class="hiSlider-item"><img src="images/5.jpg" alt="55555"></li>
- </ul>
JavaScript Code
- <script>
- $('.hiSlider1').hiSlider();
- $('.hiSlider2').hiSlider({
- isFlexible: true,
- mode: 'fade',
- isSupportTouch: false,
- isShowTitle: false,
- isShowPage: false,
- titleAttr: function(curIdx){
- return $('img', this).attr('alt');
- }
- });
- $('.hiSlider3').hiSlider({
- isFlexible: true,
- isSupportTouch: true,
- titleAttr: function(curIdx){
- return $('img', this).attr('alt');
- }
- });
- $('.hiSlider4').hiSlider({
- startSlide: 2,
- direction: 'top'
- });
- </script>
原文地址:http://www.freejs.net/article_jiaodiantu_604.html