jquery-nearest icon indicating copy to clipboard operation
jquery-nearest copied to clipboard

CSS3 transformations

Open thepixelmonk opened this issue 13 years ago • 1 comments

I'm trying to use this plugin on a bunch of elements that have been rotated (via css3's transform: rotate) and it seems to not play well. Any ideas?

thepixelmonk avatar Aug 27 '12 22:08 thepixelmonk

Ooh, that's an interesting one.

At the moment the plugin is very much built around standard rectangular bounding boxes - to be honest the thought of rotations never occurred to me (though it really should have).

What's needed is a more robust method of getting the element's bounding box that takes all transforms (translate, skew, rotate) into account. element.getBoundingClientRect() is the most accurate solution when it works, but it doesn't have full cross-browser support for CSS transforms.

gilmoreorless avatar Aug 28 '12 03:08 gilmoreorless