I am encountering difficulties when trying to reposition an image that has been previously rotated using the transform rotate property.
Specifically, after rotating the image, the top and left attributes do not update accordingly, resulting in the image appearing rotated only visually.
My goal is to freely move the image after it has been rotated, but the movement is quite imprecise.
This is the CSS class for the image:
.element {
position: absolute;
transform-origin: 50% 50%;
width:20%;
}
Below is the code used for rotation:
degree = $("#angleSlider").val();
$(ele).css('-moz-transform', 'rotate(' + degree + 'deg)');
Here is the corresponding HTML:
<div class="container">
<img class="element" src="img.png">
<img class="element" src="img1.png">
<img class="element" src="img2.png">
</div>