Skip to content

Commit e67819c

Browse files
committed
Cleaned up readme
1 parent 727eb75 commit e67819c

File tree

1 file changed

+43
-56
lines changed

1 file changed

+43
-56
lines changed

README.md

Lines changed: 43 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,49 @@ $('#gallery').stellar({
125125

126126
Don't have the level of control you need? Write a plugin!
127127

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+
128171
Writing a Scroll Property Plugin
129172
--------------------------------
130173

@@ -185,62 +228,6 @@ $.stellar({
185228
});
186229
```
187230

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:
235-
236-
### [Parallax Backgrounds](http://markdalgleish.com/projects/stellar.js/demos/backgrounds.html)
237-
238-
While the home page shows off parallax elements, Stellar.js also supports parallax backgrounds.
239-
240-
### [iOS (Using Scrollability)](http://markdalgleish.com/projects/stellar.js/demos/ios.html)
241-
242-
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'.
243-
244231
Using Stellar.js on your site?
245232
------------------------------
246233

0 commit comments

Comments
 (0)