Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.
https://github.com/jjcosgrove/jquery-aniview

animation javascript jquery jquery-plugin

Last synced: 6 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# jQuery AniView

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

## Demo

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

## Installation (via npm)

```Shell
npm install jquery-aniview
```

## CDN

Instead of a local installation you may request a remote copy of jQuery AniView from [unpkg CDN](https://unpkg.com/).

To request the latest version, use the following:

```HTML

```

For maximum security you may also decide to:

* reference a specific version of jQuery AniView

* [generate a SRI hash](https://www.srihash.org/) of that version and use it to ensure integrity

* set the [CORS settings attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) to make anonymous requests to CDN

Example:

```HTML

```

## Initialisation
```JavaScript
$('.aniview').AniView();
```
## Options
```JavaScript
var options = {
animateClass: 'animated',
animateThreshold: 100,
scrollPollInterval: 50
}
$('.aniview').AniView(options);
```
Option | Type | Description | Default
------------- | ------------- | ------------- | -------------
animateClass | string | the animate.css class to use: 'animated' enables v3.x support and 'animate__animated' to enable v4.x support | animated
animateThreshold | int | +ve numbers delay the animation sequence until the specified number of 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 user scrolling is 'polled' i.e. tested. This is in milliseconds (ms) and is an extension to jQuery's in-built 'scroll' event/handler. | 20
## Markup v3
```HTML


```

## Markup v4
```HTML


```

## Full Example

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

```HTML




My AniView Page





$(document).ready(function(){
$('.aniview-v3').AniView();
$('.aniview-v4').AniView({
animateClass: 'animate__animated'
});
});



This is my awesome animated element using v3!



This is my awesome animated element using v4!


```
## Notes

Any element already in the viewport when the user loads the page will have it's animation triggered immediately 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](https://github.com/jjcosgrove/jquery-aniview/issues)

## Authors

* Just me for now.