gpt4 book ai didi

jquery - 包括 js 来旋转图像与保留 9 个不同的图像?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:33:45 24 4
gpt4 key购买 nike

我必须实现一米,如下所示: enter image description here

现在我已经根据百分比(10-90%)将针移动到 9 个不同的位置

我可以使用两种不同的方式实现它:

1- jQuery rotate js, in which I have to include one js file in my page.
2- I have to keep 9 different images of needle and use them according to my need.

所以我想知道哪种方法更能牢记针对 google 页面速度优化页面?

谢谢

最佳答案

我认为数字 1 更快,因为浏览器不需要缓存 9 个不同的图像。

要旋转针,您可以使用 transform: rotate(Xdeg);

Transform docs

关于jquery - 包括 js 来旋转图像与保留 9 个不同的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21897796/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com