jquery.poplockit
v0.1.6
Published
[![build status](https://api.travis-ci.org/zamiang/jquery.poplockit.png)](http://travis-ci.org/zamiang/jquery.poplockit)
Downloads
2
Readme
jQuery.popLockIt
A jQuery plugin for 'locking' short content in place as the user scrolls by longer content. For example, it will lock metadata and share buttons in place as the user scrolls by a long essay or series of images.
Demos
For documentation, usage and examples please see http://zamiang.github.io/jquery.poplockit.
Note how the kitten stays as you scroll through the body of the post
Usage
Download the minified version or the development version.
Include required Javascripts
<script src="jquery.js"></script>
<script src="dist/poplockit.min.js"></script>
Create html like this
<div id="feed">
<article>
<div class="column">Left</div>
<div class="column">Center</div>
<div class="column">Right</div>
</article>
...
</div>
Apply the popLockIt plugin
$('#feed').popLockIt({
feedItems : $('#feed > article'),
columnSelector : '> .column'
});
Contributing
Contributions and pull requests are very welcome. Please follow these guidelines when submitting new code.
Modifying the code
- Fork and clone the repo.
- If needed:
npm install -g grunt
for Grunt - If needed:
brew install phantomjs
for PhantomJS - Run
npm install
to install dependencies - Run
grunt
(compiles coffeescripts and runs tests) - Run
grunt watch
while editing files to auto-compile coffeescripts and run tests - Make all changes in Coffeescript files, not JavaScript files.
Submitting pull requests
- Add tests for the change you want to make. Run
grunt jasmine
to see if tests fail. - Run
grunt
to compile new dist and make sure nothing is broken - Submit a Pull Request using GitHub.