How do I rotate an image in Javascript or CSS

后端 未结 6 1384
臣服心动
臣服心动 2020-12-06 14:04

I am creating a simple game.

I want to use jQUERY to rotate the joints making it move. I am using .animate ( http://api.jquery.com/animate/ ) to animate CSS properti

6条回答
  •  余生分开走
    2020-12-06 14:37

    Not ideal, but you could make separate image files for each rotated state of the image, then use JavaScript to change or CSS to change background-image: url('XXX'); Once the images have loaded (you could even pre-load them with JS), the animation between them should be very fast.

提交回复
热议问题