简体   繁体   English

jQuery在速度计中移动针图像

[英]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. 我不是在寻找答案,而是在寻找一些可以帮助我完成此任务的jquery库时获得帮助。

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. GSAP( http://www.greensock.com/get-started-js/ )是一个很棒的库-我知道您不想对其进行动画处理,但是有了该库,您可以获得大量的转换选项,所有这些转换选项都是领先标准jQuery和CSS3属性几英里。

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) 设置一个空的JS var(速度)
  2. On key press (arrow key, for example), increase the speed var +1 按键时(例如,箭头键),提高速度var +1
  3. Listen for changes in the speed var, then adjust up/down the speedometer needle. 聆听速度var的变化,然后向上/向下调节速度表针。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM