pulr
v1.0.0
Published
a minimal pull down control
Downloads
1
Maintainers
Readme
pulr
pulr is a very minimal touch enabled pull down control
just 110 lines of es5 code :) Imagine if we wrote it in es6?
Uses hammer.js so it works the same on the web as on mobile.
Installation
npm install pulr --save
Usage
- add some html
your pulr content, the pulr wrapper, and all your other content below...
<div id="pulr">
<div class="pulr-content">
Here is some content for your
</div>
<svg class="pulr-button" height="20" width="20"><line x1="0" y1="0" x2="20" y2="0" style="stroke:#ff0000;stroke-width:5" /></svg>
</div>
<div class="below-content">
You can push me down!
</div>
<script src="/scripts/bundle.js"></script>
- now some javascript
using node / commonJs
Use browserify or webpack to bundle your main file below to bundle.js
var pulr = require('../js/main.js');
document.addEventListener('DOMContentLoaded', function () {
var options = {resistance: 1.5}
pulr(options);
});
- you need some very minimal css