jQuery手机触屏滑动的响应式图片轮播插件



215 857 286



特效描述:jQuery 手机触屏滑动 响应式图片轮播 轮播插件,jQuery响应式图片插件,多种图片滑动轮播切换,兼容手机端的触屏滑动图片切换代码。

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="icons/entypo.css">

2. 引入JS

<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src='js/hammer.min.js'></script>
<script src='js/slider.js'></script>

3. HTML代码

	<div class="htmleaf-container">
		<header class="htmleaf-header">
			<h1>jquery支持移动手机的响应式轮播图插件 <span>A Touch slider jquery Plugin</span></h1>
		</header>
		<div class='o-sliderContainer' id="pbSliderWrap0" style="margin-top:0;">
		  <div class='o-slider' id='pbSlider0'>
		    <div class="o-slider--item" data-image="images/5.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		    <div class="o-slider--item" data-image="images/6.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		    <div class="o-slider--item" data-image="images/1.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		    <div class="o-slider--item" data-image="images/2.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		    <div class="o-slider--item" data-image="images/3.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		    <div class="o-slider--item" data-image="images/4.jpg">
		      <div class="o-slider-textWrap">
		        <h1 class="o-slider-title">This is a title</h1>
		        <span class="a-divider"></span>
		        <h2 class="o-slider-subTitle">This is a sub title</h2>
		        <span class="a-divider"></span>
		        <p class="o-slider-paragraph">This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph This is a sub paragraph </p>
		      </div>
		    </div>
		  </div>
		</div>
<pre class="pre" style="display: block;width: 600px;margin: 0 auto;">
&lt;script&gt;
$('#pbSlider0').pbTouchSlider({
  slider_Wrap: '#pbSliderWrap0',
  slider_Threshold: 10,
  slider_Speed:600,
  slider_Ease:'ease-out',
  slider_Drag : true,
  slider_Arrows: {
    enabled : true
  },
  slider_Dots: {
    class :'.o-slider-pagination',
    enabled : true
  },
  slider_Breakpoints: {
      default: {
          height: 500
      },
      tablet: {
          height: 350,
          media: 1024
      },
      smartphone: {
          height: 250,
          media: 768
      }
  }
});
&lt;/script&gt;
</pre>
<div style="clear:both;"></div>
<div class="a-container">
<h1>Touch slider jquery Plugin</h1>
<div class="a-1_2">
<div class='o-sliderContainer hasShadow' id="pbSliderWrap">
  <div class='o-slider' id='pbSlider'>
    <div class="o-slider--item" data-image="images/5.jpg"></div>
    <div class="o-slider--item" data-image="images/6.jpg"></div>
    <div class="o-slider--item" data-image="images/1.jpg"></div>
    <div class="o-slider--item" data-image="images/2.jpg"></div>
    <div class="o-slider--item" data-image="images/3.jpg"></div>
    <div class="o-slider--item" data-image="images/4.jpg"></div>
  </div>
</div>
<pre class="pre">
&lt;script&gt;
  $('#pbSlider').pbTouchSlider({
    slider_Wrap: '#pbSliderWrap',
    slider_Threshold: 50,
    slider_Speed:400,
    slider_Ease:'linear',
    slider_Drag : false,
    slider_Arrows: {
      enabled : false
    },
    slider_Breakpoints: {
        default: {
            height: 300
        },
        tablet: {
            height: 250,
            media: 1024
        },
        smartphone: {
            height: 200,
            media: 768
        }
    }
  });
&lt;/script&gt;
</pre>
</div><div class="a-1_2">
<div class='o-sliderContainer hasShadow' id="pbSliderWrap2">
  <div class='o-slider' id='pbSlider2'>
    <div class="o-slider--item" data-image="images/3.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/4.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/5.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/1.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/2.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/6.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
  </div>
</div>
<pre class="pre">
&lt;script&gt;
  $('#pbSlider2').pbTouchSlider({
    slider_Wrap: '#pbSliderWrap2',
    slider_Threshold: 25,
    slider_Speed:1000 ,
    slider_Ease:'cubic-bezier(.16,.92,0,.8)',
    slider_Dots: {
      class:'.slider-pagination',
      enabled : false
    },
    slider_Breakpoints: {
        default: {
            height: 300
        },
        tablet: {
            height: 250,
            media: 1024
        },
        smartphone: {
            height: 200,
            media: 768
        }
    }
  });
&lt;/script&gt;
</pre>
</div>
<div class='o-sliderContainer hasShadow ' id="pbSliderWrap3">
  <div class='o-slider' id='pbSlider3'>
    <div class="o-slider--item" data-image="images/1.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/2.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/3.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/4.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/5.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
    <div class="o-slider--item" data-image="images/6.jpg">
      <div class="o-slider-textWrap">
        <h1 class="o-slider-title">This is a title</h1>
        <span class="a-divider"></span>
        <h2 class="o-slider-subTitle">This is a sub title</h2>
      </div>
    </div>
  </div>
</div>
<pre class="pre">
&lt;script&gt;
  $('#pbSlider3').pbTouchSlider({
    slider_Wrap: '#pbSliderWrap3',
    slider_Threshold: 50 ,
    slider_Speed:400 ,
    slider_Ease:'linear',
    slider_Breakpoints: {
        default: {
            height: 400
        },
        tablet: {
            height: 300,
            media: 1024
        },
        smartphone: {
            height: 200,
            media: 768
        }
    }
  });
&lt;/script&gt;
</pre>
</div>
	</div>
	<script>
		$('#pbSlider0').pbTouchSlider({
		slider_Wrap: '#pbSliderWrap0',
		slider_Threshold: 10,
		slider_Speed:600,
		slider_Ease:'ease-out',
		slider_Drag : true,
		slider_Arrows: {
		  enabled : true
		},
		slider_Dots: {
		  class :'.o-slider-pagination',
		  enabled : true
		},
		slider_Breakpoints: {
		    default: {
		        height: 500
		    },
		    tablet: {
		        height: 350,
		        media: 1024
		    },
		    smartphone: {
		        height: 250,
		        media: 768
		    }
		}
		});
		$('#pbSlider').pbTouchSlider({
		slider_Wrap: '#pbSliderWrap',
		slider_Threshold: 50,
		slider_Speed:400,
		slider_Ease:'linear',
		slider_Drag : false,
		slider_Arrows: {
		  enabled : false
		},
		slider_Breakpoints: {
		    default: {
		        height: 300
		    },
		    tablet: {
		        height: 250,
		        media: 1024
		    },
		    smartphone: {
		        height: 200,
		        media: 768
		    }
		}
		});
		$('#pbSlider2').pbTouchSlider({
		slider_Wrap: '#pbSliderWrap2',
		slider_Threshold: 25,
		slider_Speed:1000 ,
		slider_Ease:'cubic-bezier(.16,.92,0,.8)',
		slider_Dots: {
		  class:'.slider-pagination',
		  enabled : false
		},
		slider_Breakpoints: {
		    default: {
		        height: 300
		    },
		    tablet: {
		        height: 250,
		        media: 1024
		    },
		    smartphone: {
		        height: 200,
		        media: 768
		    }
		}
		});
		$('#pbSlider3').pbTouchSlider({
		slider_Wrap: '#pbSliderWrap3',
		slider_Threshold: 50 ,
		slider_Speed:400 ,
		slider_Ease:'linear',
		slider_Breakpoints: {
		    default: {
		        height: 400
		    },
		    tablet: {
		        height: 300,
		        media: 1024
		    },
		    smartphone: {
		        height: 200,
		        media: 768
		    }
		}
		});
		</script>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 图片拖动 图片放大镜 图片叠加 图片翻转旋转 图片延迟加载 图片淡出淡进 图片全屏 图片头像上传 二维码 滑动 滚动切换 滑动选项卡切换 图片广告 图片放大缩小 html5图片动画 带缩略图的幻灯片 地图 flash焦点图 图片滚动 图片滑动 图片切换 图片收缩展开 旋转木马 图片轮播 自动滚动图片轮播 图标导航菜单 选项卡切换 滑动手风琴 背景切换 手风琴 图表 焦点图 幻灯片 图片轮播 图片 头像截图 带简介的焦点图 图片滑动 图片切换 图片轮播 选项卡自动切换 响应式图片

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到