You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,7 +20,7 @@ To support touch devices you also need to include touch adapter:
16
20
<scriptsrc="scrollissimo.touch.min.js"></script>
17
21
```
18
22
19
-
Then we will trigger Scrollissimo at each scroll event:
23
+
Then we will trigger Scrollissimo on each scroll event:
20
24
21
25
```html
22
26
<script>
@@ -36,38 +40,39 @@ Let we have a div called *Divy*:
36
40
```
37
41
```css
38
42
#Divy{
43
+
position: fixed;
44
+
top: 0;
45
+
left: 0;
46
+
39
47
height: 50px;
40
48
width: 50px;
49
+
41
50
background: red;
42
51
}
43
52
```
44
53
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.
46
56
47
57
```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 });
57
59
```
58
60
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.
60
64
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
+
```
63
68
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.
67
70
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/).
69
72
70
73
## 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!
0 commit comments