Skip to content

Commit a6b6c11

Browse files
committed
Add Coderwall endorse button, reformat headings
1 parent c81be5f commit a6b6c11

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

README.md

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
[Stellar.js](http://markdalgleish.com/projects/stellar.js/)
2-
===========================================================
1+
# [Stellar.js](http://markdalgleish.com/projects/stellar.js/) [![endorse](http://api.coderwall.com/markdalgleish/endorsecount.png)](http://coderwall.com/markdalgleish)
32

43
Full guide and demonstrations available at the [official Stellar.js project page](http://markdalgleish.com/projects/stellar.js/).
54

6-
Getting Started
7-
---------------
5+
## Getting Started
86

97
Stellar.js is a jQuery plugin that provides parallax scrolling effects to any scrolling element. The first step is to run `.stellar()` against the element:
108

@@ -23,8 +21,7 @@ $.stellar();
2321

2422
This will look for any parallax backgrounds or elements within the specified element and reposition them when the element scrolls.
2523

26-
Parallax Elements
27-
-----------------
24+
## Parallax Elements
2825

2926
If you want elements to scroll at a different speed, add the following attribute to any element with a CSS position of absolute, relative or fixed:
3027

@@ -36,8 +33,7 @@ The ratio is relative to the natural scroll speed, so a ratio of 0.5 would cause
3633

3734
If a ratio lower than 1 is causing the element to appear jittery, try setting its CSS position to fixed.
3835

39-
Parallax Backgrounds
40-
--------------------
36+
## Parallax Backgrounds
4137

4238
If you want an element's background image to reposition on scroll, simply add the following attribute:
4339

@@ -47,8 +43,7 @@ If you want an element's background image to reposition on scroll, simply add th
4743

4844
As with parallax elements, the ratio is relative to the natural scroll speed. For ratios lower than 1, to avoid jittery scroll performance, set the element's CSS 'background-attachment' to fixed.
4945

50-
Configuring Offsets
51-
-------------------
46+
## Configuring Offsets
5247

5348
Stellar.js' most powerful feature is the way it aligns elements.
5449

@@ -73,8 +68,7 @@ You can also modify the offsets on a per-element basis using the following data
7368
data-stellar-vertical-offset="150">
7469
```
7570

76-
Configuring Offset Parents
77-
--------------------------
71+
## Configuring Offset Parents
7872

7973
By default, offsets are relative to the element's offset parent. This mirrors the way an absolutely positioned element behaves when nested inside an element with a relative position.
8074

@@ -102,8 +96,7 @@ Still confused? [See what it looks like with its default offset parents.](http:/
10296

10397
By specifying the h2 element as the offset parent, we can ensure that the alignment of all the stars in a heading is based on the h2 and not the div further down the DOM tree.
10498

105-
Configuring Scroll Positioning
106-
------------------------------
99+
## Configuring Scroll Positioning
107100

108101
You can define what it means for an element to 'scroll'. Whether it's the element's scroll position that's changing, its margins or its CSS3 'transform' position, you can define it using the 'scrollProperty' option:
109102

@@ -127,8 +120,7 @@ Don't have the level of control you need? Write a plugin!
127120

128121
Otherwise, you're ready to get started!
129122

130-
Configuring Everything
131-
----------------------
123+
## Configuring Everything
132124

133125
Below you will find a complete list of options and matching default values:
134126

@@ -168,8 +160,7 @@ $.stellar({
168160
});
169161
```
170162

171-
Writing a Scroll Property Plugin
172-
--------------------------------
163+
## Writing a Scroll Property Plugin
173164

174165
Out of the box, Stellar.js supports the following scroll properties:
175166
'scroll', 'position', 'margin' and 'transform'.
@@ -202,8 +193,7 @@ $.stellar({
202193
});
203194
```
204195

205-
Writing a Position Property Plugin
206-
----------------------------------
196+
## Writing a Position Property Plugin
207197

208198
Stellar.js has two methods for positioning elements built in: 'position' for modifying its top and left properties, and 'transform' for using CSS3 transforms.
209199

@@ -228,8 +218,7 @@ $.stellar({
228218
});
229219
```
230220

231-
Sites Using Stellar.js
232-
----------------------
221+
## Sites Using Stellar.js
233222

234223
* [Magic City](http://mc.starz.com)
235224
* [François Hollande](http://www.parti-socialiste.fr/latimelineduchangement)
@@ -238,8 +227,7 @@ Sites Using Stellar.js
238227

239228
I'm sure there are heaps more. [Let me know if you'd like me to feature your site here.](http://twitter.com/markdalgleish)
240229

241-
How to Build
242-
------------
230+
## How to Build
243231

244232
Stellar.js uses [Grunt](http://gruntjs.com) and [PhantomJS](http://phantomjs.org/).
245233

@@ -261,20 +249,17 @@ To continuously validate and test the code while developing:
261249

262250
`grunt watch`
263251

264-
Contributing to Stellar.js
265-
--------------------------
252+
## Contributing to Stellar.js
266253

267254
Make sure that all plugin changes are made in `src/jquery.stellar.js` (`/jquery.stellar.js` and `/jquery.stellar.min.js` are generated by Grunt), and that you successfully test and build the project with `grunt` before committing.
268255

269256
If you want to contribute in a way that changes the API, please file an issue before submitting a pull request so we can discuss how to appropriately integrate your ideas.
270257

271-
Questions?
272-
----------
258+
## Questions?
273259

274260
Contact me on GitHub or Twitter: [@markdalgleish](http://twitter.com/markdalgleish)
275261

276-
License
277-
-------
262+
## License
278263

279264
Copyright 2012, Mark Dalgleish
280265
This content is released under the MIT license

0 commit comments

Comments
 (0)