一个代码示例:

html部分

<link rel='stylesheet prefetch' href='//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.3/animate.min.css'>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">

<div class="Modern-Slider">
<!-- Item -->
<div class="item">
<div class="img-fill">
<img src="/uploads/151001/sydney.jpg" alt="">
<div class="info">
<div>
<h3>Full Width Slider With Layers</h3>
<h5>You can easily add image, html formatted texts and video layers over each slide and each layer accepts unique animation.</h5>
</div>
</div>
</div>
</div>
<!-- // Item -->
<!-- Item -->
<div class="item">
<div class="img-fill">
<img src="/uploads/151001/denver.jpg" alt="">
<div class="info">
<div>
<h3>Fully responsive Scales with its container</h3>
<h5>Donec id ornare dui. Aenean tristique condimentum elit, quis blandit nisl varius sit amet. Sed eleifend felis quis massa viverra</h5>
</div>
</div>
</div>
</div>
<!-- // Item -->
<!-- Item -->
<div class="item">
<div class="img-fill">
<img src="/uploads/151001/singapore.jpg" alt="">
<div class="info">
<div>
<h3>Awesome Transtions With CSS3</h3>
<h5>Donec id ornare dui. Aenean tristique condimentum elit, quis blandit nisl varius sit amet. Sed eleifend felis quis massa viverra</h5>
</div>
</div>
</div>
</div>
<!-- // Item -->
<!-- Item -->
<div class="item">
<div class="img-fill">
<img src="/uploads/151001/village.jpg" alt="">
<div class="info">
<div>
<h3>Separate settings per breakpoint</h3>
<h5>Donec id ornare dui. Aenean tristique condimentum elit, quis blandit nisl varius sit amet. Sed eleifend felis quis massa viverra</h5>
</div>
</div>
</div>
</div>
<!-- // Item -->
</div>

<script src='http://kenwheeler.github.io/slick/slick/slick.js'></script>

js部分

$(document).ready(function() {

$(".Modern-Slider").slick({
autoplay: true,
autoplaySpeed: 10000,
speed: 600,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnHover: false,
dots: true,
pauseOnDotsHover: true,
cssEase: 'linear',
// fade:true,
draggable: false,
prevArrow: '<button class="PrevArrow"></button>',
nextArrow: '<button class="NextArrow"></button>',
});

})

css部分

.img-fill {
width: 100%;
display: block;
overflow: hidden;
position: relative;
text-align: center;
}
.img-fill img {
min-height: 100%;
min-width: 100%;
position: relative;
display: inline-block;
max-width: none;
}
*,
*:before,
*:after {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.04);
}
.Grid1k {
padding: 0 15px;
max-width: 1200px;
margin: auto;
}
.blocks-box,
.slick-slider {
margin:;
padding: 0 !important;
}
.slick-slide {
/* If RTL Make This Right */

float: left;
padding:;
/* ==== Slider Style === */
}
.Modern-Slider .item .img-fill {
height: 100vh;
background: #000;
}
.Modern-Slider .item .img-fill .info {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, .50);
line-height: 100vh;
text-align: center;
}
.Modern-Slider .item .img-fill img {
-webkit-filter: blur(5px);
filter: blur(5px);
}
.Modern-Slider .item .info > div {
display: inline-block !important;
vertical-align: middle;
}
.Modern-Slider .NextArrow {
position: absolute;
top: 50%;
right: 0px;
width: 45px;
height: 45px;
background: rgba(0, 0, 0, .50);
border: 0 none;
margin-top: -22.5px;
text-align: center;
font: 20px/45px FontAwesome;
color: #fff;
z-index:;
}
.Modern-Slider .NextArrow:before {
content: '\f105';
}
.Modern-Slider .PrevArrow {
position: absolute;
top: 50%;
left: 0px;
width: 45px;
height: 45px;
background: rgba(0, 0, 0, .50);
border: 0 none;
margin-top: -22.5px;
text-align: center;
font: 20px/45px FontAwesome;
color: #fff;
z-index:;
}
.Modern-Slider .PrevArrow:before {
content: '\f104';
}
.Modern-Slider .slick-dots {
position: absolute;
height: 5px;
background: rgba(255, 255, 255, .20);
bottom: 0px;
width: 100%;
left: 0px;
padding: 0px;
margin: 0px;
list-style-type: none;
}
.Modern-Slider .slick-dots li button {
display: none;
}
.Modern-Slider .slick-dots li {
float: left;
width: 0px;
height: 5px;
background: #d62828;
position: absolute;
left: 0px;
bottom: 0px;
}
.Modern-Slider .slick-dots li.slick-active {
width: 100%;
-webkit-animation: ProgressDots 11s both;
animation: ProgressDots 11s both;
}
.Modern-Slider .item h3 {
font: 30px/50px RalewayB;
text-transform: uppercase;
color: #fff;
-webkit-animation: fadeOutRight 1s both;
animation: fadeOutRight 1s both;
margin:;
padding:;
}
.Modern-Slider .item h5 {
margin:;
padding:;
font: 15px/30px RalewayR;
color: #fff;
max-width: 600px;
overflow: hidden;
height: 60px;
-webkit-animation: fadeOutLeft 1s both;
animation: fadeOutLeft 1s both;
}
.Modern-Slider .item.slick-active h3 {
-webkit-animation: fadeInDown 1s both 1s;
animation: fadeInDown 1s both 1s;
}
.Modern-Slider .item.slick-active h5 {
-webkit-animation: fadeInLeft 1s both 1.5s;
animation: fadeInLeft 1s both 1.5s;
}
.Modern-Slider .item.slick-active {
-webkit-animation: Slick-FastSwipeIn 1s both;
animation: Slick-FastSwipeIn 1s both;
}
.Modern-Slider {
background: #000;
/* ==== Slider Image Transition === */
}
@-webkit-keyframes Slick-FastSwipeIn {
0% {
-webkit-transform: rotate3d(0, 1, 0, 150deg) scale(0) perspective(400px);
transform: rotate3d(0, 1, 0, 150deg) scale(0) perspective(400px);
}
100% {
-webkit-transform: rotate3d(0, 1, 0, 0deg) scale(1) perspective(400px);
transform: rotate3d(0, 1, 0, 0deg) scale(1) perspective(400px);
}
}
@keyframes Slick-FastSwipeIn {
0% {
-webkit-transform: rotate3d(0, 1, 0, 150deg) scale(0) perspective(400px);
transform: rotate3d(0, 1, 0, 150deg) scale(0) perspective(400px);
}
100% {
-webkit-transform: rotate3d(0, 1, 0, 0deg) scale(1) perspective(400px);
transform: rotate3d(0, 1, 0, 0deg) scale(1) perspective(400px);
}
}
@-webkit-keyframes ProgressDots {
from {
width: 0px;
}
to {
width: 100%;
}
}
@keyframes ProgressDots {
/* ==== Slick Slider Css Ruls === */

from {
width: 0px;
}
to {
width: 100%;
}
}
.slick-slider {
position: relative;
display: block;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
}
.slick-list {
position: relative;
display: block;
overflow: hidden;
margin:;
padding:;
}
.slick-list:focus {
outline: none;
}
.slick-list.dragging {
cursor: hand;
}
.slick-slider .slick-track,
.slick-slider .slick-list {
-webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.slick-track {
position: relative;
top:;
left:;
display: block;
}
.slick-track:before,
.slick-track:after {
display: table;
content: '';
}
.slick-track:after {
clear: both;
}
.slick-loading .slick-track {
visibility: hidden;
}
.slick-slide {
display: none;
/* If RTL Make This Right */

float: left;
height: 100%;
min-height: 1px;
}
.slick-slide.dragging img {
pointer-events: none;
}
.slick-initialized .slick-slide {
display: block;
}
.slick-loading .slick-slide {
visibility: hidden;
}
.slick-vertical .slick-slide {
display: block;
height: auto;
border: 1px solid transparent;
}

Slick.js+Animate.css 结合让网页炫动起来的更多相关文章

  1. 学习animate.css包含了一组炫酷、有趣、跨浏览器的动画

    1.animate.css包含了一组炫酷.有趣.跨浏览器的动画,可以在你的项目中直接使用. 第一步:引入animate.css样式文件或者引入某些平台的CDN文件: <head> < ...

  2. wow.js+animate.css——有趣的页面滚动动画

    今天偶然间发现了一个使用特别简单的页面动画效果,还挺不错的,玩了一个上午,现在介绍一下这个滚动动画: 一.使用方法: 1.下载animate.css 2.下载wow.js 3.引用文件,像这样: &l ...

  3. wow.js wow.min.js animate.css animate.min.css

    奉献给下载不到源码的小伙伴,下载到的请忽视 wow.js (function() { var MutationObserver, Util, WeakMap, getComputedStyle, ge ...

  4. JS操作CSS随机改变网页背景

    今天有个朋友在weibo上问我可不可以用JS和CSS让页面每次刷新随机产生一张背景图,当然我的回答是可以的.具体可以这样做: 1.用JS定义一个图片数组,里面存放你想要随机展示的图片 1 2 3 4 ...

  5. WOW.js和animate.css让页面滚动时显示动画

    官网:http://mynameismatthieu.com/WOW/ bootstrap CDN服务:http://www.bootcdn.cn/wow/ 1.wow.js 实现了在网页滚动时的动画 ...

  6. IE和firefox火狐在JS、css兼容区别

    1.firefox不能对innerText支持. firefox支持innerHTML但却不支持innerText,它支持textContent来实现innerText,不过默认把多余的空格也保留了. ...

  7. 在vue中使用animate.css

    animate.css是一款前端动画库,相似的有velocity-animate 用法: 首先 npm install animate.css --save 然后在vue文件的script中引入: i ...

  8. vue2.0和animate.css的结合使用

    animate.css是一款前端动画库,相似的有velocity-animate. 上述是一个完整的结构.其中重要的几个点用箭头表示出来.首先在transition组件内部,需要定义两个基本的clas ...

  9. animate.css配合wow.min.js实现各种页面滚动效果

    有的页面在向下滚动的时候,有些元素会产生细小的动画效果.虽然动画比较小,但却能吸引你的注意.比如刚刚发布的 iPhone 6 的页面(查看).如果你希望你的页面也更加有趣,那么你可以试试 WOW.js ...

随机推荐

  1. python post提交

    # coding:utf8 import requests def login(): url = 'http://back.xiyilang.cc/staff/login.json' headers= ...

  2. JAVA记录-POST与GET方式区别

    1.get是从服务器上获取数据的一种请求,post是向服务器提交数据的一种请求. 2.get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到 ...

  3. Spring触发器触发2次问题【转】

    触发2遍任务对大多数程序而言,都会造成 数据重复 和 资源浪费. 我们在写spring触发器的timetrigger.xml配置文件的时候, 千万不要在Spring的总配置文件applicationC ...

  4. Redis和Memcached对比【转】

    Redis和Memcached对比 这两年 Redis火得可以,Redis也常常被当作 Memcached的挑战者被提到桌面上来.关于Redis与Memcached的比较更是比比皆是.然而,Redis ...

  5. mvn依赖冲突

    https://www.cnblogs.com/twoheads/p/10082453.html

  6. C语言实现二叉树的建立、遍历以及表达式的计算

    实现代码 #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <ctype ...

  7. linux 命令收集 阿里云nginx升级等 查看磁盘空间 版本等

    —————————————————— 查磁盘 df -h此命令直观的呈现出磁盘大小有多少Gdf -hl文件系统 容量 已用 可用 已用% 挂载点/dev/hdb2 75G 75G 0 100% /就是 ...

  8. VC++中LogFont设置字体(转)

    LOGFONT是Windows内部字体的逻辑结构,主要用于设置字体格式,其定义如下:typedef struct tagLOGFONTA{LONG lfHeight;LONG lfWidth;LONG ...

  9. Nginx 防盗链配置

    防盗链一般都是流媒体配置 location ~* \.(jpg|jpeg|png|bmg|swf|mp4|mp4|mmf|zip|rar|swf|flv)$ { // 对jpg|jpeg|png|bm ...

  10. Servlet.service() for servlet jsp threw exception

    报错信息如下: org.apache.catalina.core.ApplicationDispatcher invoke 严重: Servlet.service() for servlet jsp ...