Brad
Brad

Reputation: 12262

jquery move needle image in speedometer

I have a background image that is a speedometer.

I need to point the needle to the correct spot. It does not need to be animated, but I will have to take into consideration where the needle needs to point at in the half circle, based on the value (speed).

I am not looking for an answer, but for some help identifying some jquery libraries that will help me accomplish this.

Upvotes: 1

Views: 1055

Answers (1)

Adam
Adam

Reputation: 1159

GSAP (http://www.greensock.com/get-started-js/) is a great library - I know you're not wanting to animate it, but with the library, you get tonnes of transforming options all of which are miles ahead of standard jQuery and CSS3 properties.

In addition to affording you the ability to place your elements in unique positions, you can easily animate them should you ever desire to do so in the future.

As per the speed listening function;

  1. Set an empty JS var (speed)
  2. On key press (arrow key, for example), increase the speed var +1
  3. Listen for changes in the speed var, then adjust up/down the speedometer needle.

Upvotes: 1

Related Questions