full-page插件的使用
2016-07-01 17:10
281 查看
一、搭建full-page环境
1、依次下载jquery-3.0.0.min.js、jquery-ui-min.js和jquery.fullPage.js
//因为full-page是基于jquery开发的,所以必须要有jquery的支持;另要设置easing参数,所以也必须要有jquery-ui的支持。
二、html
三、index.css
四、雪碧图背景图片
1、依次下载jquery-3.0.0.min.js、jquery-ui-min.js和jquery.fullPage.js
//因为full-page是基于jquery开发的,所以必须要有jquery的支持;另要设置easing参数,所以也必须要有jquery-ui的支持。
二、html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>demo</title> <!-- 引用full-page自带的css文件 --> <link rel="stylesheet" href="css/jquery.fullPage.css"> <!-- 引用自己设置的css动画样式 --> <link rel="stylesheet" href="css/index.css"> <style> /*改进右侧的导航界面,采用雪碧图的方式*/ #fp-nav ul li a {/*未激活的样式*/ float: right; width: 21px; height: 21px; color: #8F9DA4; text-decoration: none; text-align: right; background: url("images/nav-ico.png") 5px 5px no-repeat; } /*鼠标移上去激活的样式*/ #fp-nav ul li .active { background-position: 0 bottom; } </style> <!-- 引用js文件 --> <script src="js/jquery-3.0.0.min.js"></script> <script src="js/jquery-ui.min.js"></script> <script src="js/jquery.fullPage.min.js"></script> <!-- 启动full-page --> <script> $(function() { $('#fullpage').fullpage({ // 'verticalCentered': false, anchors: ['page1', 'page2', 'page3', 'page4'], 'navigation': true, // 'navigationColor':'#cccccc', 'navigationPosition': 'right', 'navigationTooltips': ['fullPage.js', 'Powerful', 'Amazing', 'Simple'] }) }); </script> </head> <body> <div id="fullpage"> <!-- 第一画面 --> <div class="section"> <div class="bg"> <img src="images/page1-img.png" alt=""> </div> <div class="bg11"></div><!-- 此处图片作动画 --> <div class="bg12"></div><!-- 此处图片作动画 --> </div> <!-- 第二画面 --> <div class="section"> <div class="bg"> <img src="images/page2-img.png" alt=""> </div> </div> <!-- 第三画面 --> <div class="section"> <div class="bg"> <img src="images/page3-img.png" alt=""> </div> </div> </div> </body> </html>
三、index.css
.bg11{ position: absolute; width: 79px; height: 263px; left: 0; top:140px; background: url("../images/bg11.png") no-repeat; opacity: 0; transition:all 1s; } .active .bg11{ left: 400px; opacity: 1; transition-delay:0.7s; } .bg12{ position: absolute; width: 943px; height: 587px; left: 25%; top:-15%; transform:scale(0.5,0.5); opacity: 0; background: url("../images/bg12.png") no-repeat; transition:all 1s; } .active .bg12{ opacity: 1; transform:scale(1,1); transition-delay:.7s; }
四、雪碧图背景图片
相关文章推荐
- ListView之多种类型Item
- js页面跳转的方法
- 基于RecyclerView的封装,仿qq侧拉删除效果,实现下拉刷新,上拉加载更多,添加header,添加footer
- Android屏幕知识点
- Java解析Excel(JXL,仅支持Excel2003)
- Poj 1456 Supermarket
- xshell远程终端实用设置
- java一次多选的多图片异步上传
- iOS开发——单元测试
- 编写一个程序实现链式栈的各种基本运算(假设顺序表的元数基本类型为Char)
- Previous operation has not finished,SVN cleanup出错解决办法
- 电脑装系统
- java设计模式:观察者模式
- JOGL FirstDemo
- 操作服务器常用命令
- RecyclerView显示不同的类型的item
- 数据库错误5123修复
- mysql数据库大数据量的查询优化和分页测试
- c#向SQL Server中存储图片并且再从数据库中读取图片
- mysql 5.7.13 winx32 安装步骤