Giter VIP home page Giter VIP logo

onepage-scroll-animation's Introduction

onepage-scroll-animation

easy scroll up , down animation on jQuery

簡易的 Onepage 動畫 的 jQuery 套件

GitHub Page (http://lamb-mei.github.io/onepage-scroll-animation/)

Feature

What feature in onepage-scroll-animation:

  • 設定區間距離
  • 誤差容許調整
  • 允許最後一個自動置底
  • 直接跳至指定 section

Depends

  • jQuery

How to use

Simply include the jquery.onepage-scroll-animation.js file and place the following in the head of your document (make sure jQuery is included):

###Basic

var osa = $.onePageScrollAnimation({ 
section              	   : [

                                {id:"section1"   , px:0 },
                                {id:"section2"   , px:900 },
                                {id:"section3"   , px:1980 },
                                {id:"section4"   , px:2800 }
                           ]
  })

###Advanced

var osa = $.onePageScrollAnimation({ 
section          	       : [

                                {id:"section1"   , px:0 },
                                {id:"section2"   , px:900 },
                                {id:"section3"   , px:1980 },
                                {id:"section4"   , px:2800 }
                           ],
	useNear                 : true,			//啟用容許距離 	(default: false)
    near                    : 100,			//容許距離 		(default: 50)
    onLastAutoToBottom      : true			//最後一個元素自動置底 		(default: false)
    duration                : 500,			//動畫間隔 		(default: 500)
    easing                  : "swing"		//動畫效果 		(default: swing)

  })

##method

var osa = $.onePageScrollAnimation({ 
section   : [

                {id:"section1"   , px:0 },
                {id:"section2"   , px:900 },
                {id:"section3"   , px:1980},
                {id:"section4"   , px:2800 }
           ]
  })





osa.gotoSection("section1")	//Scroll to section1

gotoSection adv

gotoSection(sectionID , duration , easing)

osa.gotoSection("section2" , 1000 , "swing")

Demo

Demo1 (http://lamb-mei.github.io/onepage-scroll-animation/demo/demo1.html)

Demo2 use with Jarallax (http://lamb-mei.github.io/onepage-scroll-animation/demo/demo2.html)

onepage-scroll-animation's People

Contributors

lamb-mei avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.