Skip to content

Commit

Permalink
Added bower to the readme. Unified the src and unminified versions of…
Browse files Browse the repository at this point in the history
… the plugin.
  • Loading branch information
RobertoGonzalez committed Sep 29, 2015
1 parent c3d614f commit ce47fd4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ A jQuery plugin that switches between multiple header designs as you scroll, so

**[Check out the demo](http://aerolab.github.io/midnight.js/)** (watch the logo as you scroll).


## Quick start

Create your fixed nav (or header) as you typically would. For an example, something like this (you can use whatever markup suits you)
Expand Down Expand Up @@ -116,20 +117,34 @@ $('nav').midnight({
});
```


## Installation

Midnight is available on Bower and NPM as **midnight.js**:

```
bower install midnight.js
npm install midnight.js
```


## CDN Hosting

To lower hosting costs & have users load midnight.js faster, you can use the [jsDelivr CDN](http://www.jsdelivr.com/#!jquery.midnight) like so:
```htm
<script src="//cdn.jsdelivr.net/jquery.midnight/{version}/midnight.jquery.min.js"></script>
```


### Advanced

You can use jsDelivr's [version aliasing & concocting](https://github.com/jsdelivr/jsdelivr#version-aliasing) to serve the latest minor branch version along with dependancies. For example, to download the latest patch versions of midnight.js v1.0.z together along with jQuery v1.11.z:
```htm
<script src="//cdn.jsdelivr.net/g/[email protected],[email protected]"></script>
```


## Known Issues

On iOS <7 and older Android devices scrollTop isn't updated fluently, which creates a choppy effect. It can be fixed somewhat by wrapping the body in container and detecting touch events, but we're leaving that as an open issue. We'll probably disable the effect on older mobile devices due to bad performance.
Expand Down
5 changes: 1 addition & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ var getCopyright = function () {
};

gulp.task('build', function () {
gulp.src('./midnight.jquery.src.js')
.pipe(header(getCopyright(), {version: getVersion()}))
.pipe(concat('midnight.jquery.js'))
.pipe(gulp.dest('./'))
gulp.src('./midnight.jquery.js')
.pipe(uglify({preserveComments:'some'}))
.pipe(concat('midnight.jquery.min.js'))
.pipe(gulp.dest('./'));
Expand Down
File renamed without changes.

0 comments on commit ce47fd4

Please sign in to comment.