Coder Social home page Coder Social logo

thangnvdigdinos / jquery-aniview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjcosgrove/jquery-aniview

0.0 2.0 0.0 63 KB

A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.

JavaScript 100.00%

jquery-aniview's Introduction

jQuery AniView

A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.

Demo

http://jjcosgrove.github.io/jquery-aniview/

Initialisation

$('.aniview').AniView();

Options

var options = {
    animateThreshold: 100,
    scrollPollInterval: 50
}
$('.aniview').AniView(options);
Option Type Description Default
animateThreshold int +ve numbers delay the animation sequence until the specified number pixels have come into view. -ve numbers will trigger the animation sequence prior to the element coming into view. 0
scrollPollInterval int The frequency at which the user scrolling is 'polled' i.e. tested. This is in milliseconds (ms) and is an extension jQuery's in-built 'scroll' event/handler. 20

Markup

<div class="aniview" av-animation="slideInRight"></div>

Full Example

A typical working example (minimal) might look something like this:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My AniView Page</title>
    <link type="text/css" rel="stylesheet" href="animate.css">
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript" src="jquery.aniview.min.js"></script>
    <script>
        $(document).ready(function(){
            $('.aniview').AniView();
        });
    </script>
</head>
<body>
    <div>
        <p class="aniview" av-animation="slideInRight">
            This is my awesome animated element!
        </p>
    </div>
</body>
</html>

Notes

Any element already in the viewport when the user loads the page will have it's animation triggered imediately if one has been set. In other words, it will not wait for the user to begin scrolling before initiating the animation on these elements.

Contribute

Bugs or feature requests/contributions can be done via:

https://github.com/jjcosgrove/jquery-aniview/issues

Authors

  • Just me for now.

jquery-aniview's People

Contributors

jjcosgrove avatar

Watchers

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