forked from yanhaijing/zepto.fullpage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
196 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |