admin管理员组文章数量:1426325
How can I rotate a html element around an arbitrary point.
I know there is css rotate trasform
property that rotates the element around itself. but I want to rotate it in a way like a clock needle.
How can I rotate a html element around an arbitrary point.
I know there is css rotate trasform
property that rotates the element around itself. but I want to rotate it in a way like a clock needle.
- 1 Exact duplicate of his previous question, asked less than an hour ago. Voting to close. – Ohgodwhy Commented Aug 28, 2012 at 3:27
3 Answers
Reset to default 4You can use transform origin:
https://developer.mozilla/En/CSS/-moz-transform-origin
as mentioned here:
CSS rotation with respect to a reference point
I used the rotate to achieve this effect before. All you need to do is extend the needle png file with some transparency. Say if you have a needle with size 5x100, just make that needle to 5x200, and half of the pic is the needle, another half is transparent. then you can just rotate that image.
You're going to have to use Javascript on this one. As expected, here's a few things I found by Googling which use jQuery in particular.
- Chris Coyier
- Jon Combe
- 7 others...
本文标签: javascriptrotate a html element around a pointStack Overflow
版权声明:本文标题:javascript - rotate a html element around a point - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745470322a2659719.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论