swiper基本用法之引用(一)

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_41014370/article/details/79169704
<link rel="stylesheet" type="text/css" href="css/swiper.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/swiper.min.js"></script>
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide">Slide 1</div>
        <div class="swiper-slide">Slide 2</div>
        <div class="swiper-slide">Slide 3</div>
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>
    
    <!-- 如果需要导航按钮 -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
    
    <!-- 如果需要滚动条 -->
    <div class="swiper-scrollbar"></div>
</div>
<!-- 导航等组件可以放在container之外 -->
<script type="text/javascript">
	var mySwiper = new Swiper( '.swiper-container', {
		autoplay: 5000, //可选选项,自动滑动
		initialSlide: 2, //设定初始化时slide的索引
		direction: 'vertical', //滑动方向,可设置水平(horizontal)或垂直(vertical)
		speed: 300, //滑动速度,即slider自动滑动开始到结束的时间,也是触摸滑动时释放至贴合的时间。
		autoplayDisableOnInteraction: false,
		loop: true,
		observer: true,
		preloadImages: true,
		updateOnImagesReady: true,
		autoplayDisableOnInteraction: false,
		effect: 'coverflow',
		slidesPerView: 1.25,
		centeredSlides: true,
		spaceBetween: 0,
		coverflow: {
			rotate: 0,
			stretch: -48,
			depth: 200,
			modifier: 1,
			slideShadows: false
		},
		pagination: '.swiper-pagination',
		paginationClickable: true,
		autoplayDisableOnInteraction: false
	} )
</script>

<marquee direction="right" behavior="alternate"><font size=30 color="red">我会左右滚动哦</font></marquee>

 

 

 

 

 

 

展开阅读全文

没有更多推荐了,返回首页