Plugin sticky float for html elements
With bower:
$ bower install jquery-stickyfloat
Include on your web page:
- jQuery
- jQuery Throttle plugin
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="https://rawgit.com/cowboy/jquery-throttle-debounce/master/jquery.ba-throttle-debounce.min.js"></script>
Then include this plugin:
<script src="sticky-float/sticky-float.js"></script>
And simple usage:
$('.example').stickyfloat();
Options:
$('.example').stickyfloat({
top: 0, // top margin (number in px | default: 0)
spacer: true, // create spacer (boolean | default: true)
saveWidth: true, // save width element (boolean | default: true)
parent: false, // change parent element (boolean or jQuery element | default: false)
bottomStop: true // stop element in parent bottom (boolean | default: true)
});
That's all. Check it.