Make your website come alive by adding a lil' jGravity.
jQuery plugin to bring
gravity to your site
Version: 0.8.0
Launched: 29/04/12
Updated: 29/04/12
INTRODUCTION
jGravity adds gravity to either all or specified elements within a page. Using the plugin is as easy as $('body').jGravity(); which will use default settings to apply the gravity effect, which I think you will find quite similar to how Google presented 'Google Gravity' in an earlier Google easter egg.
I created this plugin because it simply didn't exist. I wanted a gravity type of effect for a current project and searching was very frustrating with little results. Although, I did find several leads to various other projects which contributed heavily to this plugin (mentioned below in credits).
HOW TO USE
As mentioned, all you need to do is use $('body').jGravity(); to produce the main effect. Calling the jGravity() function produces the best results when used on the main body. Oh, and jQuery is required, tested on jQuery 1.7.2.
Simple Example:
<script>
$(document).ready(function() {
$('body').jGravity();
});
</script>
Advanced Example:
<script>
$(document).ready(function() {
$('div.jGravity').live('click', function() {
$('body').jGravity({
target: 'everything',
ignoreClass: 'ignoreMe',
weight: 25,
depth: 5,
drag: true
});
});
});
</script>
Also, don't be afraid to use multiple jGravity() class on multiple targets to effect them differently.
SETTINGS
Example:
Feel free to play with the above settings until you receive the desired effect.
DEMO
You can find a demo available here: http://tinybigideas.com/assets/demo/jquery-gravity/
CREDITS
jGravity would not be possible without the work of:
IP of the Current website
in a Chrome extension
Create full websites
in minutes
Body of wise knowledge
summarised concisely
How much productive time
do you have left?