Anime.js全屏响应式图片视差切换插件代码

扬眼 2019-11-19 45 阅读

特效描述:利用Anime js实现 全屏图片视差 切换插件,利用Anime js实现全屏图片视差切换插件

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/normalize.css" />

<link rel="stylesheet" type="text/css" href="css/reset.css">

<link rel="stylesheet" type="text/css" href="assets/css/demo.css" />

2. 引入JS

<script src="assets/js/anime.min.js" type="text/javascript"></script>

<script src="assets/js/demo.js"></script>

3. HTML代码

<section class="page-wrapper" id="coidea">
<div class="slider">
<ul class="slider-list">
<li class="slider-list__item slider-list__item_active">
<span class="back__element">
<img src="assets/img/back_apple_002.png" />
</span>
<span class="main__element">
<img src="assets/img/bottle_apple_002.png" />
</span>
<span class="front__element">
<img src="assets/img/front_apple_002.png" />
</span>
<span class="title__element">
<span class="title">apple</span>
</span>
<span class="more__element">
<span class="content">
<span class="headline">apple</span>
<span class="excerpt">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Illo ratione nisi perferendis? Nemo in accusamus cupiditate officiis.</span>
<span class="link">
<div class="fill"></div>
<a href="#">Open catalog</a>
</span>
</span>
</span>
</li>
<li class="slider-list__item">
<span class="back__element">
<img src="assets/img/back_grapes_001.png" />
</span>
<span class="main__element">
<img src="assets/img/bottle_grapes_001.png" />
</span>
<span class="front__element">
<img src="assets/img/front_grapes_001.png" />
</span>
<span class="title__element">
<span class="title">grapes</span>
</span>
<span class="more__element">
<span class="content">
<span class="headline">grapes</span>
<span class="excerpt">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Illo ratione nisi perferendis? Nemo in accusamus cupiditate officiis.</span>
<span class="link">
<div class="fill fill-dark"></div>
<a href="#">Open catalog</a>
</span>
</span>
</span>
</li>
<li class="slider-list__item">
<span class="back__element">
<img src="assets/img/back_strawberry_003.png" />
</span>
<span class="main__element">
<img src="assets/img/bottle_strawberry_003.png" />
</span>
<span class="front__element">
<img src="assets/img/front_strawberry_003.png" />
</span>
<span class="title__element">
<span class="title">strawberry</span>
</span>
<span class="more__element">
<span class="content">
<span class="headline">strawberry</span>
<span class="excerpt">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Illo ratione nisi perferendis? Nemo in accusamus cupiditate officiis.</span>
<span class="link">
<div class="fill"></div>
<a href="#">Open catalog</a>
</span>
</span>
</span>
</li>
</ul>
<div class="slider__nav-bar">
<a class="nav-control"></a>
<a class="nav-control"></a>
<a class="nav-control"></a>
</div>
<div class="slider__controls">
<a class="slider__arrow slider__arrow_pv"></a>
<a class="slider__arrow slider__arrow_next"></a>
</div>
</div>
</section>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>

演示地址下载地址

最新游戏