A simple and easy to use plugin to allow elements to appear and disappear on scroll.
First release, still new to writing jQuery plugins. So suggestions for feature requests and coding style improvements will be more than welcome!
All you will need to do is to include the JavaScript file scrollAppear.js
(or the minified version scrollAppear.min.js
), as well as jQuery.
###Including files:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript" src="scrollAppear.js"></script>
-
fadeIn
: (default1
) If you want the element to fade in on scroll. Can be 1, 0, or animation duration. -
fadeOut
: (default1
) If you want the element to fade out on scroll. Can be 1, 0, or animation duration. -
appearSpot
: (default400
) Position down the page that is scrolled before element appears. Can be the id of an element. -
disappearSpot
:(defaultnone
) Position down the page that is scrolled before element disappears.
Example:
$('.header').sappear({
fadeIn : 'slow',
fadeOut : 600,
appearSpot : 'example-header',
disappearSpot : 'none'
});