Skip to content

Commit

Permalink
+ jsDelivr CDN info
Browse files Browse the repository at this point in the history
[jsDelivr CDN hosting](http://www.jsdelivr.com/#!jquery.midnight) is live.
Seem instructions are best in the README for you, since that is where you put advanced usage.
Push a new [release](https://github.com/Aerolab/midnight.js/releases/), & it should appear on jsDelivr in about 15 minutes.
  • Loading branch information
tomByrer committed Oct 1, 2014
1 parent 6747aab commit 75151c7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,22 @@ $('nav').midnight({
});
```

## 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.

You shouldn't add any sort of padding, margin or offset (top/left/right/bottom) to the nav, since it causes issues with rendering.
You shouldn't add any sort of padding, margin or offset (top/left/right/bottom) to the nav, since it causes issues with rendering.

0 comments on commit 75151c7

Please sign in to comment.