forked from SyncfusionSuccinctlyE-Books/jQuery-Succinctly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample081.html
24 lines (24 loc) · 890 Bytes
/
sample081.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">
<body>
<style>
li
{
padding-bottom: 500px;
}
</style>
<ul>
<li><a href="#" class="next">Next</a></li>
<li><a href="#" class="next">Next</a>/<a href="#" class="prev">Previous</a></li>
<li><a href="#" class="next">Next</a>/<a href="#" class="prev">Previous</a></li>
<li><a href="#" class="prev">Previous</a></li>
</ul>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script> (function ($) {
$('.next')
.click(function () { $('html, body').animate({ scrollTop: $(this).parent().next().find('a').offset().top }, 1000); });
$('.prev')
.click(function () { $('html, body').animate({ scrollTop: $(this).parent().prev().find('a').offset().top }, 1000); });
})(jQuery); </script>
</body>
</html>