Giter Club home page Giter Club logo

jquery-inview-checker's Introduction

Info

jQuery inViewChecker works in Animate CSS
Download animate.css from here: https://daneden.github.io/animate.css/

Usage

First, add the following:

<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script src="javascript/jquery/jquery.inViewChecker.js" type="text/javascript"></script>
<link href="stylesheet/animate.css" rel="stylesheet">
<link href="javascript/main.js" rel="stylesheet">
<link href="javascript/main.css" rel="stylesheet">

Your element should contains "data-animation" tag, which is the name of the animation as CSS class.
'data-delay' and 'data-duration' are extra HTML tags.

<div class="branding" data-animation="fadeIn" data-delay="0.5s" data-duration="1s">

Then, initialize the Viewport:

$(function() {
	// Run plugin here...
	 $('.vp').inViewChecker({
	   mobile: 768, // or 992 (it's your choice),
	   classToAdd: 'animated', // by default,
	   repeat: false, // by default, true value will repeat your animation
	   scrollVertical: true // by default, false value will never load animation when scroll from bottom to top
	});
});

and place this CSS

@media (min-width: 992px) {
	.vp {
		-webkit-animation-name: none;
		animation-name: none;
		visiblity: hidden;
		opacity: 0;
		-webkit-animation-delay: 0s; 
		animation-delay: 0s
	}
}

License

MIT license. Copyright © 2016.

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.