利用jQuery实现手机触屏滑动切换图片代码



44 175 59



特效描述:利用jQuery实现 手机触屏 滑动切换 图片代码,利用jQuery实现手机触屏滑动切换图片代码

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/zzsc.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css" />
<link rel="stylesheet" href="css/fontawesome-all.min.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">

2. 引入JS

<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>

3. HTML代码

<div class="demo" style="background: #f7f8fa;">
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div id="news-slider" class="owl-carousel">
					<div class="post-slide">
						<div class="post-header">
							<a href="#" class="subtitle">Lorem ipsum</a>
							<h3 class="post-title"><a href="#">Latest News Post</a></h3>
						</div>
						<div class="pic">
							<img src="images/img-1.jpg" alt="">
						</div>
						<ul class="post-bar">
							<li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
							<li><i class="fa fa-clock-o"></i> March 5,2019</li>
							<li><i class="fa fa-comments"></i> <a href="#">2 Comment</a></li>
						</ul>
						<p class="post-description">
							Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas gravida nulla eu massa efficitur, eu hendrerit ipsum efficitur. Morbi vitae velit ac.
						</p>
						<a href="#" class="read-more">read more</a>
					</div>
					<div class="post-slide">
						<div class="post-header">
							<a href="#" class="subtitle">Lorem ipsum</a>
							<h3 class="post-title"><a href="#">Latest News Post</a></h3>
						</div>
						<div class="pic">
							<img src="images/img-2.jpg" alt="">
						</div>
						<ul class="post-bar">
							<li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
							<li><i class="fa fa-clock-o"></i> March 7,2019</li>
							<li><i class="fa fa-comments"></i> <a href="#">3 Comment</a></li>
						</ul>
						<p class="post-description">
							Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas gravida nulla eu massa efficitur, eu hendrerit ipsum efficitur. Morbi vitae velit ac.
						</p>
						<a href="http://www.51qianduan.com//" class="read-more">read more</a>
					</div>
					<div class="post-slide">
						<div class="post-header">
							<a href="#" class="subtitle">Lorem ipsum</a>
							<h3 class="post-title"><a href="#">Latest News Post</a></h3>
						</div>
						<div class="pic">
							<img src="images/img-3.jpg" alt="">
						</div>
						<ul class="post-bar">
							<li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
							<li><i class="fa fa-clock-o"></i> March 8,2019</li>
							<li><i class="fa fa-comments"></i> <a href="#">5 Comment</a></li>
						</ul>
						<p class="post-description">
							Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas gravida nulla eu massa efficitur, eu hendrerit ipsum efficitur. Morbi vitae velit ac.
						</p>
						<a href="#" class="read-more">read more</a>
					</div>
					<div class="post-slide">
						<div class="post-header">
							<a href="#" class="subtitle">Lorem ipsum</a>
							<h3 class="post-title"><a href="#">Latest News Post</a></h3>
						</div>
						<div class="pic">
							<img src="images/img-4.jpg" alt="">
						</div>
						<ul class="post-bar">
							<li><i class="fa fa-users"></i> <a href="#">Admin</a></li>
							<li><i class="fa fa-clock-o"></i> March 9,2019</li>
							<li><i class="fa fa-comments"></i> <a href="#">6 Comment</a></li>
						</ul>
						<p class="post-description">
							Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas gravida nulla eu massa efficitur, eu hendrerit ipsum efficitur. Morbi vitae velit ac.
						</p>
						<a href="#" class="read-more">read more</a>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$("#news-slider").owlCarousel({
			items : 3,
			itemsDesktop:[1199,3],
			itemsDesktopSmall:[1000,2],
			itemsMobile : [650,1],
			navigationText:false,
			autoPlay:true
		});
	})
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>



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


热门标签: 图片拖动 图片放大镜 文字拖动 文字放大缩小 图片放大缩小 数字放大缩小 拖动排序 弹出层拖动 拖动拽动 缩放放大缩小 缩放切换

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

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

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