$(".버튼클래스").click(function(){ $(".이벤트 대상자").stop().animate({"margin-top" : "0"}, 500); });
$(".버튼클래스").click(function(){ $(".이벤트 대상자").stop().animate({"margin-top" : "-600px"}, 500); });
$(".버튼클래스").click(function(){ $(".이벤트 대상자").stop().animate({"margin-top" : "-1200px"}, 500); });
$(".버튼클래스").click(function(){ $(".이벤트 대상자").stop().animate({"margin-top" : "-1800px"}, 500); });
<div class="main1" id="mainTop">
<img src="../image/test/mainImg01.png"/>
</div>
<div><a class="page" href="#mainTop" title="DASAN TOOL"></a></div>
jQuery(document).ready(function($) {
$(".page").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
});
});
[출처] 네비게이션을 클릭하면 원하는 위치로 스크롤!|작성자 깡깡
'html5/jQuery' 카테고리의 다른 글
fade menu (2) | 2015.02.26 |
---|---|
one page scroll navi (0) | 2014.11.28 |
가로 슬라이더 (0) | 2014.11.25 |
심플 이미지 슬라이더 (0) | 2014.11.22 |
펼침메뉴 animate (0) | 2014.11.21 |