Skip to content

Commit badcc83

Browse files
committed
docs: add more examples
1 parent cc086f0 commit badcc83

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $(document).ready( function(){
3434
}
3535
```
3636

37-
When using `infinite: true` and a delay, the delay will only occur before the first loop
37+
When using `infinite: true` and a delay, the delay will only occur before the first loop, not on every loop.
3838

3939
## Examples
4040

@@ -46,7 +46,7 @@ $('#your-id').animateCSS('fadeIn');
4646
### With callback
4747
```js
4848
$('#your-id').animateCSS('fadeIn', function(){
49-
alert('Boom! Animation Complete');
49+
console.log('Boom! Animation Complete');
5050
});
5151
```
5252

@@ -60,17 +60,35 @@ $('#your-id').animateCSS('fadeIn', {delay: 500});
6060
$('#your-id').animateCSS('fadeIn', {
6161
delay: 1000,
6262
callback: function(){
63-
alert('Boom! Animation Complete');
63+
console.log('Boom! Animation Complete');
6464
}
6565
});
6666
```
6767

68+
### Chain multiple animations
69+
If you use the standard jQuery chaining mechanism, each animation will fire at the same time so you have to include the next animation in the callback.
70+
```js
71+
$('#your-id').animateCSS('fadeInUp', function() {
72+
console.log('Boom! First animation Complete');
73+
$(this).animateCSS("fadeOutUp", function(){
74+
console.log('Boom Boom! Second animation Complete');
75+
})
76+
});
77+
```
78+
79+
### Offset animations
80+
You can offset animations by using the delay mechanism
81+
```js
82+
$('#your-id').animateCSS('fadeIn');
83+
$('#another-id').animateCSS('fadeIn', {delay:100});
84+
```
85+
6886
If you want to hide an element when the page loads and then apply an effect, it might look something like this:
6987

7088
```css
71-
.js #your-id {
72-
visibility:hidden;
73-
}
89+
.js #your-id {
90+
visibility:hidden;
91+
}
7492
```
7593
```js
7694
$(window).load( function(){
@@ -81,9 +99,6 @@ $(window).load( function(){
8199
```
82100

83101
## Release History
84-
1.1.0
85-
- Rewrite in CoffeeScript
86-
- Allow custom `.animated` class
87-
- Allow for `.infinite` animation
88-
- Add grunt for consistent build output
89-
- Add Bower support
102+
Please consult the official [changelog][changelog]
103+
104+
[changelog]: https://github.com/craigmdennis/animateCSS/blob/master/CHANGELOG.md

0 commit comments

Comments
 (0)