Closed MikkCZ closed 6 years ago
OK, looking at the CSS specs, this is not easily possible. But one option is to use Image
and make a transformed copy of the image to replace the original (and save the original to some data attribute of the modified element).
One other drawback is I need to register context menu for other elements than just images, which may be confusing for the users, when the see entry in the context menu, even if they haven't clicked an image. I may just use a completely different context menu for rotating background of the clicked element.
A lot of websites today (including mozilla.org) do not use
<img>
tags, but include the some images via CSS background. This should be also supported to rotate or zoom.So instead of checking if the element is
<img>
, I should include a check for background image, and find a way, how to rotate/zoom it possibly without moving the element itself and its content.