Funny jQuery Plugin For Fart Noises As You Scroll - fartscroll.js

Funny jQuery Plugin For Fart Noises As You Scroll - fartscroll.js
File Size: Unknown
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

fartscroll.js is a funny and simple jQuery plugin for fart noises as you scroll down/up the web page.

How to use it:

1. Include jQuery library and fartscroll.js on your webpage

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="fartscroll.js"></script>

2. The javascript

<script>
$(document).ready(function() {
    // Ensure the page always has more scrolling
    $(document).scroll(function() {
    while ((window.pageYOffset + window.innerHeight) >= $(this).height() - (window.innerHeight / 2)) {
    $('ul').append('<li>Testing.</li>');
}
    }).scroll();

    fartscroll(800); // Fart every 800 pixels scrolled
});
</script>

3. Markup html structure

<ul>
<li>Testing.</li>
<li>Testing.</li>
<li>Testing.</li>
...
</ul>

This awesome jQuery plugin is developed by theonion. For more Advanced Usages, please check the demo page or visit the official website.