这篇文章主要介绍了JavaScript怎么实现移动端手势滑动的幻灯片切换效果的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇JavaScript怎么实现移动端手势滑动的幻灯片切换效果文章都会有所收获,下面我们一起来看看吧。
创新互联是一家集网站建设,青河企业网站建设,青河品牌网站建设,网站定制,青河网站建设报价,网络营销,网络优化,青河网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。
代码如下:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>支持移动端手势滑动的幻灯片切换制作</title>
<meta name="keywords" content="支持移动端手势滑动的幻灯片切换制作" />
<meta name="description" content="支持移动端手势滑动的幻灯片切换制作" />
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="dist/swipeslider.css">
</head>
<body>
<div class="htmleaf-container">
<header class="htmleaf-header">
<h2>支持移动端手势滑动的幻灯片切换</h2>
</header>
<article class="container">
<section>
<figure id="full_feature" class="swipslider">
<ul class="sw-slides">
<li class="sw-slide">
<img src="img/summer_beach.jpg" alt="Summer beach concept">
</li>
<li class="sw-slide">
<img src="img/lang_yie_ar_kung_fu.jpg" alt="Lang from Yie Ar Kung Fu">
</li>
<li class="sw-slide">
<img src="img/wanted1.jpg" alt="Example of a not sized slide">
</li>
<li class="sw-slide">
<img src="img/tiny_vacation.jpg" alt="Tiny Tina">
</li>
<li class="sw-slide">
<img src="img/borderlands_tiny_tina.jpg" alt="Tiny Tina from Borderlands 2">
</li>
<li class="sw-slide">
<img src="img/redhead.jpg" alt="Redhead girl">
</li>
</ul>
</figure>
</section>
<section>
<h3>Content slider</h3>
<p>Image slider can work as content slider.</p>
<figure id="content_slider" class="swipslider">
<ul class="sw-slides">
<li class="sw-slide">
<figure class="wanted sw-content">
<img src="img/wanted1.jpg" alt="Mafia Boss">
<div class="description">
<h2>Wanted: Mafia Boss</h2>
<p>
<strong>Description:</strong> accused in organization of criminal association that terrorise peaceful citizens of the Foo town.
</p>
<p>
<strong>Distinguishing marks:</strong>
</p>
<ul>
<li>smokes big cigars;</li>
<li>wears a luxurious suit (even while sleeping);</li>
<li>rose buttonhole.</li>
</ul>
<p class="award">
<strong>Award:</strong> 200 000$ for reliable location information.
</p>
</div>
</figure>
</li>
<li class="sw-slide">
<figure class="wanted sw-content">
<img src="img/wanted2.jpg" alt="Mafia Boss">
<div class="description">
<h2>Wanted: Underboss</h2>
<p>
<strong>Description:</strong> accused in being extremely rude with the members of his gang, shooting on public and
uncontrolled behaviour under the influence.
</p>
<p>
<strong>Distinguishing marks:</strong>
</p>
<ul>
<li>always smooth;</li>
<li>carrying a gun;</li>
<li>drinking too much Scotch.</li>
</ul>
<p class="award">
<strong>Award:</strong> 1000$ for more information on this subject.
</p>
</div>
</figure>
</li>
<li class="sw-slide">
<figure class="wanted sw-content">
<img src="img/wanted3.jpg" alt="Mafia Boss">
<div class="description">
<h2>Wanted: Big guy nickname 'Peewee'</h2>
<p>
<strong>Description:</strong> accused in littering, bad language.
</p>
<p>
<strong>Distinguishing marks:</strong>
</p>
<ul>
<li>extremely big;</li>
<li>little vocabulary;</li>
<li>bald.</li>
</ul>
<p class="award">
<strong>Award:</strong> 700$ for teaching him some good manners.
</p>
</div>
</figure>
</li>
<li class="sw-slide">
<figure class="wanted sw-content">
<img src="img/wanted4.jpg" alt="Mafia Boss">
<div class="description">
<h2>Wanted: Cold blooded dude</h2>
<p>
<strong>Description:</strong> kills the audience with bad puns and pronounced eyebrows.
</p>
<p>
<strong>Distinguishing marks:</strong>
</p>
<ul>
<li>carrying a blunt, plastic knife;</li>
<li>wears napkin in right pocket;</li>
<li>bold as a kneecap.</li>
</ul>
<p class="award">
<strong>Award:</strong> 150 000$ for comedian courses for that person.
</p>
</div>
</figure>
</li>
</ul>
</figure>
</section>
<section>
<h3>Responsiveness</h3>
<p>Slider can resize itself with the window accordingly. Also image self resizing to fit slider.</p>
<figure id="responsiveness" class="swipslider">
<ul class="sw-slides">
<li class="sw-slide">
<img src="img/children_game_concept01.jpg" alt="Concept for children game">
</li>
<li class="sw-slide">
<img src="img/children_game_concept02.jpg" alt="Another Concept for children game">
</li>
</ul>
</figure>
</section>
<section>
<h3>Customizable</h3>
<p>Elements of slider can be easily customized.</p>
<figure id="customizability" class="swipslider">
<ul class="sw-slides">
<li class="sw-slide" style="background-color: #53c780">
<span class="slide-number">1</span>
</li>
<li class="sw-slide" style="background-color: #53c7b5">
<span class="slide-number">2</span>
</li>
<li class="sw-slide" style="background-color: #53b1c7">
<span class="slide-number">3</span>
</li>
<li class="sw-slide" style="background-color: #538dc7">
<span class="slide-number">4</span>
</li>
<li class="sw-slide" style="background-color: #535cc7">
<span class="slide-number">5</span>
</li>
</ul>
</figure>
</section>
</article>
</div>
<div style="width: 100%; height: auto; line-height: 25px; text-align: center;">
</div>
<script src="http://www.5iweb.com.cn/statics/js/jquery.1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="dist/swipeslider.min.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#full_feature').swipeslider();
$('#content_slider').swipeslider({
transitionDuration: 600,
autoPlayTimeout: 10000,
sliderHeight: '300px'
});
$('#responsiveness').swipeslider();
$('#customizability').swipeslider({
transitionDuration: 1500,
autoPlayTimeout: 4000,
timingFunction: 'cubic-bezier(0.38, 0.96, 0.7, 0.07)',
sliderHeight: '30%'});
});
</script>
</body>
</html>
关于“JavaScript怎么实现移动端手势滑动的幻灯片切换效果”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“JavaScript怎么实现移动端手势滑动的幻灯片切换效果”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注创新互联行业资讯频道。
新闻名称:JavaScript怎么实现移动端手势滑动的幻灯片切换效果
网站地址:https://www.cdcxhl.com/article2/jsdeoc.html
成都网站建设公司_创新互联,为您提供响应式网站、外贸建站、微信公众号、小程序开发、网站导航、云服务器
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联