My Name is Kay....

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

추가 포스팅이 이뤄지지 않는 블로그입니다. 문의는 wkzkfmxksi@gmail.com 으로 연락주세요.
kay
조회 수 12680 추천 수 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 Formatnumber , 콤마처리

    Date2015.11.03 CategoryPlugIn Bykay Views2098
    Read More
  2. jQuery Org Chart - 조직도 그리기

    Date2014.09.01 CategoryPlugIn Bykay Views16616
    Read More
  3. Star Rating Plugin - jQuery 별점 주기

    Date2014.05.01 CategoryPlugIn Bykay Views13225
    Read More
  4. jQuery Plugin For Auto Resizing iFrame - iFrame Resizer

    Date2014.03.10 CategoryPlugIn Bykay Views105623
    Read More
  5. jquery-syaku.rolling 상하좌우 롤링 ( 자동롤링 , 버튼 )

    Date2014.02.09 CategoryPlugIn Bykay Views20164
    Read More
  6. 스크롤 따라 다니는 배너

    Date2013.09.14 CategoryPlugIn Bykay Views4517
    Read More
  7. Tree 메뉴만들기

    Date2013.08.14 CategoryPlugIn Bykay Views5648
    Read More
  8. 자동 롤링 배너 Jquery

    Date2013.08.07 CategoryPlugIn Bykay Views13883
    Read More
  9. Moodular - 회전,슬라이더, 터치 ,모자이크

    Date2013.05.04 CategoryPlugIn Bykay Views5352
    Read More
  10. sliding horizontal parallax - parallax 공부 샘플

    Date2013.04.17 CategoryPlugIn Bykay Views6151
    Read More
  11. jQuery Zoom - 이미지 줌 제어 ( 휠 , 클릭 , 오버 )

    Date2013.04.17 CategoryPlugIn Bykay Views8426
    Read More
  12. fancyBox - 레이어팝업 (추천)

    Date2013.04.16 CategoryPlugIn Bykay Views32412
    Read More
  13. makisu - 메뉴 접기(?)

    Date2013.04.16 CategoryPlugIn Bykay Views18446
    Read More
  14. poshytip - 툴팁

    Date2013.04.15 CategoryPlugIn Bykay Views11803
    Read More
  15. tiptip - 툴팁

    Date2013.04.14 CategoryPlugIn Bykay Views17886
    Read More
  16. vGrid - 브라우저 너비에 따른 가변 그리드

    Date2013.04.08 CategoryPlugIn Bykay Views6956
    Read More
  17. Smooth Scroll - 스크롤 이동 ( 속도 , 위치 )

    Date2013.04.06 CategoryPlugIn Bykay Views12680
    Read More
  18. lightBox2 - 레이어 팝업

    Date2013.04.06 CategoryPlugIn Bykay Views6136
    Read More
Board Pagination Prev 1 Next
/ 1