swiper实现卡片悬浮切换幻灯片效果代码

代码语言:html

所属分类:幻灯片

代码描述:swiper实现卡片悬浮切换幻灯片效果代码

代码标签: 悬浮 切换 幻灯片 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/swiper.5.3.8.css">
<style>
    .img_swiper{
	width: 800px;
	margin: 0 auto;
	position: relative;
}
.img{
	width: 100%;
	height: 100%;
}
.img_swiper .swiper-button-prev{
    width: 40px;
    height: 40px;
/*     background-image: url(//repo.bfw.wiki/bfwrepo/image/5f7ab7a3a8387.png);
background-size: cover; */
    /* left: -80px; */
}
.img_swiper .swiper-button-next{
    width: 40px;
    height: 40px;
/*     background-image: url(//repo.bfw.wiki/bfwrepo/image/5f7ab7cfd3599.png);
background-size: cover; */
    /* right: -80px; */
}
.img_swiper .swiper-button-prev.swiper-button-disabled{
    background-image: url(//repo.bfw.wiki/bfwrepo/image/5f7ab7a3a8387.png);
    background-color: #FFFFFF;
}
.img_swiper .swiper-button-next.swiper-button-disabled{
    background-image: url(//repo.bfw.wiki/bfwrepo/image/5f7ab7cfd3599.png);
    background-color: #FFFFFF;
}
.img_swiper .swiper-slide{
	width: 440px;
}
.swiper_slide_img{
	/* height: 440px; */
	perspective: 300px;
	-webkit-perspective: 500;
	/* position: absolute; */
	margin-left: -240px;
	position: relative;
}
.swiper_slide_img:first-child{
    margin-left: 0;
}
.swiper_slide_img>img{
    width: 360px;
    height: 500px;
    transform: rotateY(35deg) scale(0.7);
    transition: 1s;
    border-radius: 20px;
    cursor: url('//repo.bfw.wiki/bfwrepo/image/603857094e4e4.png'), default;
}
.swiper_slide_img:hover{
    z-index: 1000;
}
.swiper_slide_img:hover img{
    transform: rotateY(0deg) scale(1);
	transition: 1s;
}
.pic_container{
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #34353A;
    display: none;
    z-index: 200;
    overflow-y: scroll;
}
.pic_container_inner{
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.pic_container_inner>img{
    width: 100%;
    border-radius: 10px;
    cursor: url('//repo.bfw.wiki/bfwrepo/image/6038571b445ab.png'), default;
}
</style>

</head>
<body style="padding-top:100px;">

<div class="img_swiper">
	<div class="swiper-container">
		<div class="swiper-wrapper">
			<div class="swiper-slide">
				<div class="swiper_slide_img" data-url="//repo.bfw.wiki/bfwrepo/image/5d6537c07e9bd.png">
					<img src="//repo.bfw.wiki/bfwrepo/image/5d6537c07e9bd.png" class="img" alt="">
				</div>
			</div>
			<div class="swiper-slide">
				<div class="swiper_slide_img" data-url="//repo.bfw.wiki/bfwrepo/image/5d65390e19eb6.png">
					<img src="//repo.bfw.wiki/bfwrepo/image/5d65390e19eb6.png" class="img" alt="">
				</div>
			</div>
			<div class="swiper-slide">
				<div class="swiper_slide_img" data-url="//repo.bfw.wiki/bfwrepo/image/5d65399a14ba1.png">
					<img src="//repo.bfw.wiki/bfwrepo/image/5d65399a14ba1.png" class="img" alt="">
				</div>
			</div>
			<div class="swiper-slide">
				<div class="swiper_slide_img" data-url="//repo.bfw.wiki/bfwrepo/image/5d65ea7d8bc8b.png">
					<img src="//repo.bfw.wiki/bfwrepo/image/5d65ea7d8bc8b.png" class="img" alt="">
				</div>
			</div>
			<div class="swiper-slide">
				<div class="swiper_slide_img" data-url="//repo.bfw.wiki/bfwrepo/image/5d65eac5da40b.png">
					<img src="//repo.bfw.wiki/bfwrepo/image/5d65eac5da40b.png" class="img" alt="">
				</div>
			</div>
		</div>
	</div>
	<div class="swiper-button-prev one"></div>
	<div class="swiper-button-next one"></div>
</div>
<!-- 图片放大 -->
<div class="pic_container">
	<div class="pic_container_inner">
		<img src="" id="box" style="transform: scale(1.5);" alt="">
	</div>
</div>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.2.11.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/swiper.5.3.8.js"></script>
<script type="text/javascript" charset="utf-8">
    
    $(function() {
	var img_swiper = null
	img_swiper = new Swiper('.img_swiper .swiper-container', {
		sli.........完整代码请登录后点击上方下载按钮下载查看

网友评论0