Giter Site home page Giter Site logo

orzscroll's Introduction

jquery.orzScroll.js


偵測視窗捲動到該元素即加入動畫效果,該元素離開視窗範圍則將取消動畫,下次滾動至該元素時可再啟動動畫效果,請搭配animate css服用

USAGE

需使用jquery然後引入jquery.orzScroll.js

<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="jquery.orzScroll.min.js"></script>

並且加入animate css

<link rel="stylesheet" href="animate.css">

套用方法只需要將元素加上此function即可

$(function(){
	$('div').orzScroll();
});

設定

目前有三個參數可以作設定

animation

指定動畫的效果,請參考animate css, 預設為 'fadeInLeft'

animation:'fadeInRight'

delay

指定動畫觸發的延遲時間,可針對某些特定情形作延遲,預設為 '0s'

delay:'0.5s'

offset

在某些情況下,或許會希望往下滾動後不要那麼快消失,一直在那邊跑也很煩,可將offset設定大一點,往下滾動再滾回來時就不會一直消失-觸發,預設為 0

offset:100

範例

$(function(){
	$('div:nth-child(even)').orzScroll();
	$('div:nth-child(odd)').orzScroll({
		animation:'fadeInRight',
		delay:'2s',
		offset:300
	});
});

orzscroll's People

Watchers

James Cloos avatar Artemis 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.