Skip to content

Commit 4a94f17

Browse files
author
Vladimir Kudinov
committed
Releasing version 0.3.0
1 parent c249038 commit 4a94f17

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Scrollissimo
22
Javascript plugin for smooth scroll-controlled animations
33

4+
Scrollissimo can animate Greensock's tweens and timelines on user's scroll.
5+
46
## Get started
57

6-
The first step you need is to include jQuery and Scrollissimo to your page:
8+
The first step you need is to include Greensock and Scrollissimo to your page:
79

810
```html
9-
<script src="jquery.min.js"></script>
11+
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js"></script>
12+
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TimelineLite.min.js"></script>
13+
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js"></script>
1014
<script src="scrollissimo.min.js"></script>
1115
```
1216

@@ -16,7 +20,7 @@ To support touch devices you also need to include touch adapter:
1620
<script src="scrollissimo.touch.min.js"></script>
1721
```
1822

19-
Then we will trigger Scrollissimo at each scroll event:
23+
Then we will trigger Scrollissimo on each scroll event:
2024

2125
```html
2226
<script>
@@ -36,38 +40,39 @@ Let we have a div called *Divy*:
3640
```
3741
```css
3842
#Divy{
43+
position: fixed;
44+
top: 0;
45+
left: 0;
46+
3947
height: 50px;
4048
width: 50px;
49+
4150
background: red;
4251
}
4352
```
4453

45-
Now we will animate Divy's width. At the begining of page its width will be equal to 50px. And as we scroll its width will be grow up to 300px after we have scrolled for 10% of page's height.
54+
Now we will animate Divy's width. At the begining of page its width will be equal to 50px. And as we scroll its width will be grow up to 300px after we have scrolled for 500 pixels.
55+
The first let's create Grensock's tween.
4656

4757
```js
48-
Scrollissimo.add({
49-
target: $('#Divy'),
50-
property: 'width',
51-
from: 50,
52-
to: 300,
53-
suffix: 'px',
54-
start: '0',
55-
duration: '10%'
56-
});
58+
var divyTween = TweenLite.to(document.getElementById('divy'), 500, { width: 300, paused: true });
5759
```
5860

59-
That is all you need to do to make a simple animation. Result you may see [here](https://jsfiddle.net/1ff5Lv9x/5/).
61+
**NOTE**: Your tween must be paused. You can make it easily by specifing ```paused: true``` or creating tween by constructor ```new TweenLite()```.
62+
63+
Then we need to add this tween to Scrollissimo.
6064

61-
##PercentPixel units
62-
PercentPixel units used to specify tween's parameters such as ```start```, ```duration``` and also custom ```scrollTop``` value in a ```.knock()``` method.
65+
```js
66+
Scrollissimo.add(divyTween, 0);
67+
```
6368

64-
PercentPixel parameters may be specified as:
65-
* percentage of total page's height: ```'54%'```
66-
* pixel's quantity: ```'1000px'``` or ```'1000'``` or ```1000```
69+
The second argument is start scroll value in pixels.
6770

68-
***NB***: animation's ```start``` parameter you can also specify as a relative value by adding "-" or "+" before value. For example ```start: '-50px'``` means animation will start 50 pixels earlier than it should.
71+
That is all you need to do to make a simple animation. Result you may see [here](https://jsfiddle.net/7d9kxpe1/2/).
6972

7073
## Changelog
74+
* v0.3.0:
75+
* Now Scrollissimo is powered by [Greensock](http://greensock.com/). Animate your Greensock's tweens and timelines by scrolling. Enjoy of it's smoothness!
7176
* v0.2.0:
7277
* Support of relative start values
7378
* v0.1.0:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scrollissimo",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"homepage": "https://github.com/Promo/Scrollissimo",
55
"authors": [
66
"Vladimir Kudinov <[email protected]>"

lib/scrollissimo.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
2-
* Created by frux on 12/05/15.
2+
* Scrollissimo
3+
* Javascript plugin for smooth scroll-controlled animations
4+
* @version 0.3.0
5+
* @author frux <[email protected]>
6+
* @url https://github.com/Promo/scrollissimo
37
*/
48
(function(doc, win){
59
var Queue,

0 commit comments

Comments
 (0)