Skip to content

Commit

Permalink
release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Sajnóg committed Jun 18, 2016
1 parent 9bc42b8 commit f6dc732
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,20 @@ Down below you can find list of all anchor-placement options.

####API

AOS object is exposed as global variable, for now there are only two methods available:
AOS object is exposed as a global variable, for now there are three methods available:

* init
* refresh
* `init` - initialize AOS
* `refresh` - recalculate all offsets and positions of elements (called on window resize)
* `refreshHard` - reinit array with AOS elements and trigger `refresh` (called on DOM changes that are related to `aos` elements)

Running:
Example execution:
```javascript
AOS.refresh();
```
will recalculate all offsets and positions of elements.
It could be handy in older browsers which don't support mutation observer.
By default AOS is watching for DOM changes and if there are any new elements loaded asynchronously or when something is removed from DOM it calls refresh automatically. In older browsers like IE you might need to call `AOS.refresh()` by yourself.

By default AOS is watching for DOM changes and if there are any new elements loaded asynchronously or when something is removed from DOM it calls `refreshHard` automatically. In browsers that don't support `MutationObserver` like IE you might need to call `AOS.refreshHard()` by yourself.
`refresh` method is called on window resize and so on, as it doesn't require to build new store with AOS elements and should be as light as possible.

### Global settings

Expand Down Expand Up @@ -306,6 +308,9 @@ If you have any questions, ideas or whatsoever, please let me know in `issues` o
## Changelog
#### 1.2.2
- Fix AOS refreshing on asynchronously loaded elements
#### 1.2.1
- Add main file to package.json
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aos",
"version": "1.2.1",
"version": "1.2.2",
"homepage": "git://github.com/michalsnik/aos.git",
"authors": [
"Michał Sajnóg <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aos",
"version": "1.2.1",
"version": "1.2.2",
"description": "Animate on scroll library",
"homepage": "http://michalsnik.github.io/aos/",
"author": "Michał Sajnóg <[email protected]>",
Expand Down

0 comments on commit f6dc732

Please sign in to comment.