I have a div element that gets rotated with -webkit-transform: rotate(45deg). If I try to access it's current position after rotation like this
var x = $('#tap-area').offset().left;
var y = $('#tap-area').offset().top;
it returns me not the actual values of where the original top left corner is, but where is the top left corner of the bounding box of the whole div (which is physically furthest top left, outside of the DIV).
How can I calculate/get the original top left corner of the div after it gets rotated
Eg: If I rotate it by 90deg, the value I would like to get now would be top right. If I rotate it by 180deg, the value I would like to get now would be bottom right.
I need this, so I could set another DIV element to always stay attached to the original top left corner of the element, so that it would change it's position depending on how it was rotated.
Thanks.