GithubHelp home page GithubHelp logo

doubleotoo / jquery-approach Goto Github PK

View Code? Open in Web Editor NEW

This project forked from srobbin/jquery-approach

1.0 1.0 0.0 114 KB

A jQuery plugin that allows you to animate style properties based on the cursor’s proximity to an object.

Home Page: http://srobbin.com/jquery-plugins/jquery-approach/

License: GNU General Public License v2.0

jquery-approach's Introduction

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.

Demo

See the demo/demo.html and demo/demo2.html files for a demonstration of how jQuery Approach works
or view a live demo.

Note: demo/demo2.html does not work in older versions of IE that don’t support “opacity.”

Options

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)

distance

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

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):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/jquery.approach-1.0.min.js"></script>

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):

<script type="text/javascript">
  $("#my_object").pageSlide({
    "fontSize": "48px"
  }, 200);
</script>

Support

Please file a ticket on our Github issues tracker.

Changelog

1.01

  • Checks to see if opacity is supported by the browser (IE). If not, attempts to user filter:alpha(opacity=xx) instead.

jquery-approach's People

Stargazers

 avatar

Watchers

 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.