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
Copy file name to clipboardExpand all lines: README.md
+43-56Lines changed: 43 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,49 @@ $('#gallery').stellar({
125
125
126
126
Don't have the level of control you need? Write a plugin!
127
127
128
+
Otherwise, you're ready to get started!
129
+
130
+
Configuring Everything
131
+
----------------------
132
+
133
+
Below you will find a complete list of options and matching default values:
134
+
135
+
```js
136
+
$.stellar({
137
+
// Set scrolling to be in either one or both directions
138
+
horizontalScrolling:true,
139
+
verticalScrolling:true,
140
+
141
+
// Set the global alignment offsets
142
+
horizontalOffset:0,
143
+
verticalOffset:0,
144
+
145
+
// Select which property is used to calculate scroll.
146
+
// Choose 'scroll', 'position', 'margin' or 'transform',
147
+
// or write your own 'scrollProperty' plugin.
148
+
scrollProperty:'scroll',
149
+
150
+
// Select which property is used to position elements.
151
+
// Choose between 'position' or 'transform',
152
+
// or write your own 'positionProperty' plugin.
153
+
positionProperty:'position',
154
+
155
+
// Enable or disable the two types of parallax
156
+
parallaxBackgrounds:true,
157
+
parallaxElements:true,
158
+
159
+
// Hide parallax elements that move outside the viewport
160
+
hideDistantElements:true,
161
+
162
+
// Set how often the viewport size is detected
163
+
viewportDetectionInterval:1000,
164
+
165
+
// Customise how elements are shown and hidden
166
+
hideElement:function($elem) { $elem.hide(); },
167
+
showElement:function($elem) { $elem.show(); }
168
+
});
169
+
```
170
+
128
171
Writing a Scroll Property Plugin
129
172
--------------------------------
130
173
@@ -185,62 +228,6 @@ $.stellar({
185
228
});
186
229
```
187
230
188
-
Configuring Everything
189
-
----------------------
190
-
191
-
Below you will find a complete list of options and matching default values:
192
-
193
-
```js
194
-
$.stellar({
195
-
// Set scrolling to be in either one or both directions
196
-
horizontalScrolling:true,
197
-
verticalScrolling:true,
198
-
199
-
// Set the global alignment offsets
200
-
horizontalOffset:0,
201
-
verticalOffset:0,
202
-
203
-
// Select which property is used to calculate scroll.
204
-
// Choose 'scroll', 'position', 'margin' or 'transform',
205
-
// or write your own 'scrollProperty' plugin.
206
-
scrollProperty:'scroll',
207
-
208
-
// Select which property is used to position elements.
209
-
// Choose between 'position' or 'transform',
210
-
// or write your own 'positionProperty' plugin.
211
-
positionProperty:'position',
212
-
213
-
// Enable or disable the two types of parallax
214
-
parallaxBackgrounds:true,
215
-
parallaxElements:true,
216
-
217
-
// Hide parallax elements that move outside the viewport
218
-
hideDistantElements:true,
219
-
220
-
// Set how often the viewport size is detected
221
-
viewportDetectionInterval:1000,
222
-
223
-
// Customise how elements are shown and hidden
224
-
hideElement:function($elem) { $elem.hide(); },
225
-
showElement:function($elem) { $elem.show(); }
226
-
});
227
-
```
228
-
229
-
Demos
230
-
-----
231
-
232
-
### Parallax Elements
233
-
234
-
The best demonstration of parallax elements is on the [Stellar.js home page](http://markdalgleish.com/projects/stellar.js/). Other demos are listed below:
Mobile Safari halts code execution during scroll so you can't use normal scroll events to animate. By using an iOS scrolling library we're able to bypass this limitation. In order to use Scrollability, Stellar.js is run against the scrolling element and the 'scrollProperty' option is set to 'transform'.
0 commit comments