1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 |
<script type= "text/javascript" src= "http://code.jquery.com/jquery-1.8.0.min.js" ></script>
$(document).ready( function () {
$( "#p1" ).click( function () {
$( "html, body" ).animate({
scrollTop: $( "#div1" ).offset().top }, {duration: 500,easing: "swing" });
return false ;
});
$( "#p2" ).click( function () {
$( "html, body" ).animate({
scrollTop: $( "#div2" ).offset().top }, {duration: 500,easing: "swing" });
return false ;
});
$( "#p3" ).click( function () {
$( "html, body" ).animate({
scrollTop: $( "#div3" ).offset().top }, {duration: 500,easing: "swing" });
return false ;
});
}); |