Friday, October 16th, 2009

jQuery Approach; Creep up on your radials

Category: jQuery

We have featured the creative work of Scott Robbin many times before. This time he comes at us with a cool new jQuery Approach plugin.

It works very similar in nature to animate, except it’s based on distance instead of time. As the user’s cursor approaches an element, more of an animated style’s value is applied, proportional to the radial distance.

He has fun demos that show that lighting up the world is as easy as:


  1. $("#wrap img").approach({
  2.     "opacity": 0.8
  3. }, 100);


Posted by Dion Almaer at 6:30 am

2.7 rating from 86 votes


Comments feed TrackBack URI

With the slew of new JS libraries and effects, I’m constantly reminded of the early Flash days. It won’t be long ’til we’ve got animated splash pages with sound and 3D menu systems again! All using HTML 5’s audio tag, a drawing library (eg., Raphael) and jQuery! Wee!

Comment by MichaelThompson — October 16, 2009

I’m a fan of the Proximity plugin myself.

Comment by igaenssley — October 16, 2009

Thanks Ian.

The plugins do do similar stuff. My Proximity plugin seems to be a bit more generalised than Approach, so hopefully they should be complementary.

It seems that the biggest difference is between the two is that Proximity leaves what to do with the distance information entirely up to the developer.

Anyway it’s all good stuff to see. Hopefully there’s a lot more fun and subtlety to be had from website user experiences yet.

Comment by edeverett — October 16, 2009

$.each and mousemove? I stopped reading there.

Rule #1 of jQuery – don’t use it for any fast timer or event. And don’t use recursive bullshit like $.each ever.

That, my friend, is why it uses 100% CPU (Firefox).

Comment by Darkimmortal — October 16, 2009

“don’t use it for any fast timer or event.”
Of course performance will be an issue for plugins doing this kind of stuff. They should be used with caution and awareness of your target audience. But for me that’s a pre-condition of using jQuery or Javascript at all.
I’d be very interested to hear people’s constructive ideas on increasing performance as it’s not an area I know much about. Both plugins throttle the rate at which they use the mousemove events which goes a long way to making performance acceptable.

Comment by edeverett — October 16, 2009

Store references to any elements you’re likely to be using (there’s probably some silly reason not to, but meh), use for loops (no recursive $.each) and do as much as possible with hard coded DOM manipulation or lighter animation libraries than jQuery’s built in one (GX is awesome).

Comment by Darkimmortal — October 16, 2009

How is $.each recursive?

Comment by eyelidlessness — October 18, 2009

“But for me that’s a pre-condition of using jQuery or Javascript at all.”
You can do pretty impressive stuff with JS/DHTML and have it running even on most mobile devices. I don’t know the CPU demands of jQuery, but we do stuff – and I’ve seen others do stuff – that’s pretty jaw-dropping, and runs perfectly on my [old] iPhone even too…

Comment by ThomasHansen — October 18, 2009

it’s very funny plugin!!

Comment by 1234567890qwert — October 19, 2009

This is pretty neat. Not to steal it’s thunder or anything, but here’s a neat little pre-pre-pre-alpha demo of how to do something similar in MooTools.

You can drag the box.

Comment by SubtleGradient — October 21, 2009

Leave a comment

You must be logged in to post a comment.