My Name is Kay....

DIY , 먹방 , 개발 , 육아 , 여행 좋아합니다.
AdBlock 사용시 화면이 정상적으로 노출되지 않습니다.
포스팅 관련 문의 및 개발 문의는 Email : wkzkfmxksi@gmail.com

추가 포스팅이 이뤄지지 않는 블로그입니다. 문의는 wkzkfmxksi@gmail.com 으로 연락주세요.
kay
조회 수 12679 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

스크롤 서서히 움직이기...

 

PlugIn Url : http://github.com/kswedberg/jquery-smooth-scroll (downLoad : jquery.smooth-scroll.js  )

Test Url : http://www.uhoon.co.kr/test/904.html

 

 

* Option  

{
  offset: 0,

  // one of 'top' or 'left'
  direction: 'top',

  // only use if you want to override default behavior
  scrollTarget: null,

  // fn(opts) function to be called before scrolling occurs.
  // `this` is the element(s) being scrolled
  beforeScroll: function() {},

  // fn(opts) function to be called after scrolling occurs.
  // `this` is the triggering element
  afterScroll: function() {},
  easing: 'swing',
  speed: 400,

  // coefficient for "auto" speed
  autoCoefficent: 2

}


샘플 소스

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />  
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> 
<script src="/test/904/jquery.smooth-scroll.js"></script> 
<style>
a {
  color: #8ad459;
  text-decoration: none;
} 
</style>
</head>
<script type="text/javascript">
$(document).ready(function($) {
      $('a').smoothScroll({
        speed: 1000,
        easing: 'easeInOutCubic'
      });  
  }); 
</script>  
<body>
<div style="position: fixed; top:50px;background: #fff"> 
<ul style="list-style: none;">
<li></li> 
<li><a href="#Red" >Red</a></li>
<li><a href="#blue">blue</a></li>
<li><a href="#pink">pink</a></li> 
</ul>
</div>
<div>
<div style="background-color:red;height:400px;" id="Red"> </div>
<div style="background-color:blue;height:400px;" id="blue"/> </div>
<div style="background-color:pink;height:400px;" id="pink"/> </div> 
<div style="height:300px;"></div> 
</div>
</body>
</html>



관련 게시글


?
  • ?
    은혜 2015.06.03 10:41

    지금 포트폴리오 만들면서 smoothScroll이 안되어서 계속 찾고 있던 중인데 ㅠㅠ 정말 감사합니다.

  • ?
    kay 2015.06.17 08:56

    10원짜리 팁임에도...찾아주셔서 감사합니다. 좋은 하루 되세요!

    혹 디자이너 시라면..연계작업가능하시다면...


  1. 자동 롤링 배너 Jquery

  2. 스크롤 따라 다니는 배너

  3. vGrid - 브라우저 너비에 따른 가변 그리드

  4. Tree 메뉴만들기

  5. tiptip - 툴팁

  6. Star Rating Plugin - jQuery 별점 주기

  7. Smooth Scroll - 스크롤 이동 ( 속도 , 위치 )

  8. sliding horizontal parallax - parallax 공부 샘플

  9. poshytip - 툴팁

  10. Moodular - 회전,슬라이더, 터치 ,모자이크

  11. makisu - 메뉴 접기(?)

  12. lightBox2 - 레이어 팝업

  13. jquery-syaku.rolling 상하좌우 롤링 ( 자동롤링 , 버튼 )

  14. jQuery Zoom - 이미지 줌 제어 ( 휠 , 클릭 , 오버 )

  15. jQuery Plugin For Auto Resizing iFrame - iFrame Resizer

  16. jQuery Org Chart - 조직도 그리기

  17. jQuery Formatnumber , 콤마처리

  18. fancyBox - 레이어팝업 (추천)

Board Pagination Prev 1 Next
/ 1