heygrady / transform

jQuery 2d transformation plugin
437 stars 87 forks source link

Respect already positioned elements #6

Open rossfishkind opened 14 years ago

rossfishkind commented 14 years ago

I found an issue where if you have an element that is already absolutely positioned (in IE), upon rotation, the element will be re-positioned to top: 0, left: 0. Is there any solution for this that people know of? Thanks.

heygrady commented 14 years ago

Wrap the element in another div and position that element. The transform-origin of elements in IE is faked using relative positioning to make it appear the same as it does in other browsers.

<div class="wrapper"><div class="transform">Transform me</div></div>
<style>.wrapper{position: absolute; left: 100px;}</style>
<script>$('.transform').transform({rotate: '45deg'});</script>
noxsulivan commented 13 years ago

in IE8, the element (img) don't rotates, but moves clipped inside that wrapper, what can i do about?