Fork me on GitHub

fart.js

Add the most natural sound on earth to your pages

Documentation

Basics

Initiate the fart player:
fart = new Fart();

You can set the default sound when initiating the fart script:
fart = new Fart({
default_sound: farts.toot,
loop: true,
volume: 100
});

To play a default sound, use this syntax:
fart.play();

To play a particular sound, use this syntax:
fart.play([sound]);

Examples:
fart.play(farts.toot);

fart.play('tuppence');

Availiable sounds

Options

default_sound
You can set the default sound when initiating the fart script. This is the sound that plays when you just call fart.play();
{default_sound: farts.raspberry}
Possible values:
Default: raspberry
loop
You can set the fart to play once or loop forever
{loop: false}
Possible values: true, false
Default: false
volume
You can set the volume of the player
{volume: 50}
Possible values: 0 - 100
Default: 50


Examples

Click to fart
Bind a fart to a click. Uses the default Raspberry sound.

Toot an' show
Fire of a toot whilst displaying an image. Hide the image after the tooting has ceased.
A juicy alert
Alert your users with a real Trouser Trumpet
Mouse Mayhem
Attach a nice Fizzler to mouse events
Mouse over me!
More Demos

Available Farts

  • Toot
  • Jack the Ripper
  • Snap Crackle Plop
  • Squit
  • Squat
  • Raspberry
  • Tuppence
  • Lift Off
  • Trouser Trumpet
  • The Fizzler
  • Windy Valley
  • Eine Kleine Fartmusik
  • NEW Fartception
  • NEW Fart.1
clickto hear the sound

Download

Rquirements

Files

fart.js
fart.min.js

Contact

tel@jsfart.com
@74656c