Skip to content

Commit

Permalink
添加demo
Browse files Browse the repository at this point in the history
1.添加 事件和方法的demo
2.修改原demo文件
  • Loading branch information
yanhaijing committed Feb 10, 2015
1 parent e9933ac commit 5f10dcf
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 52 deletions.
32 changes: 6 additions & 26 deletions demo/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Document</title>
<link rel="stylesheet" href="../src/zepto.fullpage.css">
<style>
.wp{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
}
.page1{
background: red;
}
.page2{
background: yellow;
}
.page3{
background: maroon;
}
.page4{
background: green;
}
</style>
<link rel="stylesheet" href="css/global.css">
</head>
<body>
<div class="wp">
<div class="wp-inner">
<div class="page page1"></div>
<div class="page page2"></div>
<div class="page page3"></div>
<div class="page page4"></div>
<div class="page page1">1</div>
<div class="page page2">2</div>
<div class="page page3">3</div>
<div class="page page4">4</div>
</div>
</div>
<span class="start"><b></b></span>
<script src="js/zepto.min.js"></script>
<script src="../src/zepto.fullpage.js"></script>
<script>
Expand Down
76 changes: 76 additions & 0 deletions demo/css/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.wp{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
}
.page{
font-size: 72px;
line-height: 320px;
text-align: center;
}
.page1{
background: red;
}
.page2{
background: yellow;
}
.page3{
background: maroon;
}
.page4{
background: green;
}

/* 箭头 */
@-webkit-keyframes start {
0%,30% {
opacity: 0.2;
-webkit-transform: translate(0,10px);
}
60% {
opacity: 1;
-webkit-transform: translate(0,0);
}
100% {
opacity: 0.2;
-webkit-transform: translate(0, -5px);
}
}
@keyframes start {
0%,30% {
opacity: 0.2;
transform: translate(0,10px);
}
60% {
opacity: 1;
transform: translate(0,0);
}
100% {
opacity: 0.2;
transform: translate(0, -5px);
}
}
.start{
position: fixed;
left: 50%;
margin-left: -17px;
top: 95%;
margin-top: -34px;
width: 34px;
height: 34px;
}
.start b{
position: absolute;
left: 50%;
top: 10px;
margin-left: -9px;
width: 19px;
height: 12px;
background: url(img/arrow.png);
background-size: 100% 100%;
-webkit-animation: start 1.5s infinite ease-in-out;
animation: start 1.5s infinite ease-in-out;
}
Binary file added demo/css/img/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 6 additions & 26 deletions demo/drag.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Document</title>
<link rel="stylesheet" href="../src/zepto.fullpage.css">
<style>
.wp{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
}
.page1{
background: red;
}
.page2{
background: yellow;
}
.page3{
background: maroon;
}
.page4{
background: green;
}
</style>
<link rel="stylesheet" href="css/global.css">
</head>
<body>
<div class="wp">
<div class="wp-inner">
<div class="page page1"></div>
<div class="page page2"></div>
<div class="page page3"></div>
<div class="page page4"></div>
<div class="page page1">1</div>
<div class="page page2">2</div>
<div class="page page3">3</div>
<div class="page page4">4</div>
</div>
</div>
<span class="start"><b></b></span>
<script src="js/zepto.min.js"></script>
<script src="../src/zepto.fullpage.js"></script>
<script>
Expand Down
63 changes: 63 additions & 0 deletions demo/event.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Document</title>
<link rel="stylesheet" href="../src/zepto.fullpage.css">
<link rel="stylesheet" href="css/global.css">
<style>
.indicator{
position: fixed;
right: 10px;
top: 50%;
margin-top: -40px;
}
.indicator li{
margin-top: 10px;
width: 10px;
height: 10px;
border-radius: 100px;
background: rgba(0,0,0,0.5);
text-indent: -9999px;
list-style: none;
}
.indicator li.cur{
background: rgba(255,255,255,0.5);
}
</style>
</head>
<body>
<div class="wp">
<div class="wp-inner">
<div class="page page1">1</div>
<div class="page page2">2</div>
<div class="page page3">3</div>
<div class="page page4">4</div>
</div>
<ul class="indicator">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
<span class="start"><b></b></span>
<script src="js/zepto.min.js"></script>
<script src="../src/zepto.fullpage.js"></script>
<script>
$('.wp-inner').fullpage({
change: function (e) {
console.log('change', e.cur, e.prev);
$('.indicator li').removeClass('cur').eq(e.cur).addClass('cur');
},
beforeChange: function (e) {
console.log('beforeChange', e.cur, e.prev);
},
afterChange: function (e) {
console.log('afterChange', e.cur, e.prev);
}
});
</script>
</body>
</html>
45 changes: 45 additions & 0 deletions demo/method.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Document</title>
<link rel="stylesheet" href="../src/zepto.fullpage.css">
<link rel="stylesheet" href="css/global.css">
<style>
#prev, #next{
position: fixed;
z-index: 1;
right: 10px;
}
#prev{
top: 100px;
}
#next{
top: 150px;
}
</style>
</head>
<body>
<a href="" id="prev" data-dir="movePrev">向前</a>
<a href="" id="next" data-dir="moveNext">向后</a>
<div class="wp">
<div class="wp-inner">
<div class="page page1">1</div>
<div class="page page2">2</div>
<div class="page page3">3</div>
<div class="page page4">4</div>
</div>
</div>
<span class="start"><b></b></span>
<script src="js/zepto.min.js"></script>
<script src="../src/zepto.fullpage.js"></script>
<script>
$('.wp-inner').fullpage();
$('#prev, #next').on('click', function (e) {
e.preventDefault();
$.fn.fullpage[$(this).data('dir')]();
});
</script>
</body>
</html>

0 comments on commit 5f10dcf

Please sign in to comment.