Creating A Floating Effect with jQuery and CSS3 - Waterfloat

Creating A Floating Effect with jQuery and CSS3 - Waterfloat
File Size: 4.1 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Waterfloat is a tiny jQuery plugin which takes advantage of CSS3 transforms to create a smooth 'floating' effect on DOM element, like an object floats in water.

How to use it:

1. Add the latest version of jQuery JavaScript library and the jQuery waterfloat plugin to the web page.

<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="waterFloat.js"></script>

2. Animate a DOM element with a subtle floating effect using waterFloat() method.

// waterFloat(elm,t,d,v)
// elm = target element
// t = duration
// d = degree
// v = vertical offset
waterFloat(element,900,3,8)

3. That's it. This effect works well on all major web browsers which support CSS3 transform property.


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