Rotate image clockwise or anticlockwise inside a div using javascript

前端 未结 5 1789
情歌与酒
情歌与酒 2020-12-05 11:27

HI, Is there a way by which I can rotate an image inside a div clockwise or anticlockwise.

I have a main fixed width div[overflow set to hidden] with images loaded f

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 12:00

    There is other way to rotate images without any filters / html5.. it's nasty and useless in real world, but possible.

    You can store your image as array of pixels, for javascript. Write function to perform rotation with it and encode it to base64 datauri, bmp could be easy and replace image.src with it.

    There will be some limitation about filesize and support in old browser and of course terrible performance..

提交回复
热议问题