Giter Club home page Giter Club logo

water-ripple's Introduction

water-ripple

Water ripples effect in javascript.

This javascript jQuery plugin to simulate water ripples on the surface of an image. There are quite a few code snipplets on the internet to simulate water ripples in javascript-canvas. However the problem with them is that they're published as bare-bone scripts with the settings hard coded inside the script. So the main task of this script is to give the developer an option to run this cool animation as the jQuery plugin. See the demo: http://andyvr.github.io/water-ripple/demo/

Usage Example:

Include source files:

<html>
<head>
<script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="js/ripple.js"></script>
...

Add an image or a div tag with the image background to the body:

<img id="ripple" src="image.jpg" />

or

<div id="ripple" style="background-image:url(image.jpg);width:600px;height:300px;">
</div>

Run the plugin:

<script type="text/javascript">
$(document).ready(function() {
    $("#ripple").waterripple();
});
</script>

Also you can pass various parameters to the plugin:

$("#ripple").waterripple({ arbitrary: 5000 });

Available parameters/options:

arbitrary

type: int, default: 1000 - time in miliseconds to generate a new random water ripple. By default it generates a new ripple every second. 0 - turns off random ripples

onclick

type: boolean, default: false - generate a new ripple on the mouse click

onmove

type: boolean, default: false - generate a series of ripples when moving the mouse over the animation

water-ripple's People

Contributors

andyvr avatar

Watchers

James Cloos avatar Eduardo Linares avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.