Giter VIP home page Giter VIP logo

jquery-inertiascroll's Introduction

jquery-inertiaScroll

慣性スクロールのアニメーション用jQueryプラグイン

Demo

demo

##Depends

  • jQuery 1.9.1

Browsers

IE10+ and other new browsers.

Options

key Value initial value
parent body直下のすべてのコンテンツを囲う要素を指定 none
childDelta1 少ないと滑らかになる、大きいと進みすぎるので注意 0.02
childDelta2 子要素のスクロールスピード、大きすぎると滑らかさが無くなる 0.1
parentDelta parentのスクロールスピード 0.08

data Attribute

key Value initial value
data-speed 各要素のスクロールスピードを個別に変更出来る 1
data-margin 各要素のtranslate3dの値の切片を設定出来る 0

Usage

  <div id="content">
    <header>header!</header>
    <div id="box1" class="box" data-speed="1" data-margin="100"></div>
    <div id="box2" class="box" data-speed="7"></div>
    <div id="box3" class="box" data-speed="2"></div>
    <div id="box4" class="box" data-speed="5"></div>
    <div id="box5" class="box" data-speed="3" data-margin="200"></div>
    <div id="box6" class="box" data-speed="1"></div>
    <div id="box7" class="box" data-speed="2"></div>
    <div id="box8" class="box" data-speed="8"></div>
    <div id="box9" class="box" data-speed="1"></div>
    <div id="box10" class="box" data-speed="5"></div>
    <footer>footer!</footer>
  </div>


	<script>
	$(function(){

	  $(".box").inertiaScroll({
	    parent: $("#content")
	  });

	});  
	</script>


Lisence

Copyright(c) 2016 Go Nishiduka Licensed under the MIT license.

jquery-inertiascroll's People

Contributors

underground0930 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.