Home

Awesome

Release

Release is a JavaScript plugin that enables the execution of an action after the user keeps the mouse pressed for a custom amount of time.

Build
Status

Demos

Basic usage

First you need to attach release stylesheet and javascript files:

<link rel="stylesheet" href="css/release.css">
<script src="js/release.js"></script>

Now you can instantiate a Release object by using the following code:

<script>var release = new Release('.release', {onRelease: myFunction()});</script>

With the above code, all elements with the release class will receive a mouseup event that will execute myFunction()_ after 3 seconds (default value).

Initialization options

defaults: {
    animationTime: 200,
    increaseRate: 15,
    onRelease: '',
    releaseTime: 3000
}

Development

Release development tasks are managed by Grunt. To install all the necessary packages, just invoke:

npm install

These are the available grunt tasks:

The source files are located inside the src directory. Release stylesheet was created using sass/compass, so make sure you have the compass gem installed on your system.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Test your changes to the best of your ability.
  4. Update the documentation to reflect your changes if they add or changes current functionality.
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

License

"THE BEER-WARE LICENSE" (Revision 42):

As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

Bitdeli Badge