Waves

Click effect inspired by Google's Material Design

v0.6.6

See the examples
Hint: click button or background

Examples

Buttons

Button A

Button A

Icons

DIVs & Images

Flat Box
Float Box

Image Source: © Moyan Brenn. Flickr

Action/Event

Works fully with jQuery and JavaScript click event handlers, like Snarl

Buttons

{{#code class="lang-markup"}}

Button A

Button A

{{/code}}

Icons

{{#code class="lang-markup"}}

{{/code}}

DIVs & Images

{{#code class="lang-markup"}}
Flat Box
Float Box

{{/code}}

Action/Event

{{#code class="lang-markup"}}

{{/code}}

Getting Started

It's easy to use Waves. Download the latest version of Waves from Github repository. Just include waves.min.css and waves.min.js to your HTML file. And Waves is ready to use!

{{#code class="lang-markup"}} Waves example Click Here {{/code}}

Advanced:
Waves also provide LESS, SCSS, and SASS source. So, feel free to used it :)

To put Waves effect on your buttons, just add .waves-effect and .waves-button class to your buttons.

{{#code class="lang-markup"}} A Tag {{/code}}

Normally, the effect will not work on single tag element like <input>. That's why Waves will wrap <input> inside <i> automatically if you display the effect.

{{#code class="lang-markup"}} {{/code}}

Waves can also be applied with icons (like FontAwesome) by using waves-circle, so you can give the icons Waves effect. It's simple, just give additional .waves-effect and .waves-circle class to your <i> tags and Waves will wrap icon inside circle spot that will prevent Waves effect spreading.

{{#code class="lang-markup"}} {{/code}}

You can also give Waves effect to other element tag like <div> or <img>. All you need to do is just put .waves-effect class. For element that not have closing tag like <img>, you have to wrap it inside <span>, and for element that have blocky display like <div>, you need to put .waves-block class to keep its shape.

{{#code class="lang-markup"}}
Block A
{{/code}}

Styling

Waves give you capabilities to color your .waves-effect. You can do this by set up the color and background-color/background properties on your element style (or CSS file).

{{#code class="lang-markup"}} {{/code}}

By default, Waves ripple is darker. If you want the ripple is lighter, you can set .waves-light along side .waves-effect class. Make sure the element has been colored, because if it haven't colored yet, you cannot see the light ripple.

{{#code class="lang-markup"}} {{/code}}

Not only give your "Waves effect", Waves also provide float effect when you click an element by adding .waves-float class to the element. Once again, before put float effect, your have to make sure the element has been colored, to prevent weird shadow on the element.

{{#code class="lang-markup"}} {{/code}}

Quick Fix

IE Tap highlight on Windows Phone

By default if you access a web page using IE in Windows Phone, you will get tap highlight effect when you tapping a link or button and this highlight will shadowed Waves effect. To prevent this thing happen, you will need to add msapplication-tap-highlight meta tag on your header.

{{#code class="lang-markup"}} Your Web Page {{/code}}

API

displayEffect(config)

Arguments

{{#code class="lang-javascript"}} { // How long Waves effect duration // when its clicked (in milisecond) duration: 500 } {{/code}}

FAQ

Browser support?

Can I make Waves better?

Yes, I strongly encourage you to contribute to make Waves better. So, if you find a bug, or have nice idea for Waves development, please mention me.