srobbin / jquery-approach

A jQuery plugin that allows you to animate style properties based on the cursor’s proximity to an object.
http://srobbin.com/jquery-plugins/jquery-approach/
GNU General Public License v2.0
167 stars 20 forks source link

h1. jQuery Approach

Approach is a jQuery plugin that allows you to animate style properties based on the cursor’s proximity to an object. It works in a very similar manner to jQuery animate, however it animates over distance instead of time.

h2. Demo

See the @demo/demo.html@ and @demo/demo2.html@ files for a demonstration of how jQuery Approach works or "view a live demo":http://srobbin.com/jquery-plugins/jquery-approach/.

Note: @demo/demo2.html@ does not work in older versions of IE that don't support "opacity."

h2. Options

h3. styles

Which styles you'd like to animate. Accepts the same syntax and properties as jQuery animate. Also, if you have the jQuery UI Core Effects installed, it will also accept color-based properties. (type=Object, default=None)

h3. distance

Set the minimum radial distance where you'd like the animation to begin (type=integer, default=400)

h2. Setup

Include the jQuery library and Approach plugin files in your webpage tag (preferably at the bottom of the page, before the closing BODY tag):



Note: The example above uses the Google hosted version of jQuery; there is also a jQuery source file included with this distribution, if you would like to host it yourself. Note #2: If you are using color animations, you must also include the jQuery UI Effects Core source code (also included in this distribution).

Next, add the following javascript code (where my_object is replace with the object(s) you'd like to approach/animate, whatever style properties you fancy, and a minimum distance):


h2. Support

Please file a ticket on our Github issues tracker.

h2. Changelog

h3. 1.01