You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the maintainer of an animation / effects library, this issue has been a thorn in my side multiple times. Trying to determine if an element is positioned using left, top or right, bottom or some combination of all of them is currently impossible to do in a cross browser way. The "Computed Style" of right and bottom in webkit will return auto but FF spoils the day by returning an actual px value (which by my interpretation is actually the correct value to return).
After animating elements, my code must either assume that the element was positioned left and top since there is no way to determine what the initial positioning actually was, or accept some sort of configuration parameter to tell it which to use. This means that after running my effect code on your arbitrary div that was positioned using right and bottom it will no longer be positioned relative to the bottom right as its relative container resizes.
The issue of knowing if a CSS property is auto probably has more uses than just left and top. I could see width and height also being useful to know if it is auto or specifically set.
Specific Issues
Makes it impossible to detect if an element is positioned with right and bottom
Specific Suggestions
isCSSAuto( property ) - Some method (be it on the computed style object, or somewhere else) could be provided to determine if a style property is auto before computation.
right and bottom shouldn't return auto on a computed style object.
The text was updated successfully, but these errors were encountered:
This was also a problem for us in the jQuery UI Accordion redesign. We wanted to determine whether all panels should be the height of the tallest panel or the height that the accordion element was before applying the JavaScript and styles. This would be based on whether the element had an explicit height or an auto height. Since we couldn't determine if the element had auto height, we had to add an option.
As the maintainer of an animation / effects library, this issue has been a thorn in my side multiple times. Trying to determine if an element is positioned using
left
,top
orright
,bottom
or some combination of all of them is currently impossible to do in a cross browser way. The "Computed Style" of right and bottom in webkit will returnauto
but FF spoils the day by returning an actual px value (which by my interpretation is actually the correct value to return).After animating elements, my code must either assume that the element was positioned
left
andtop
since there is no way to determine what the initial positioning actually was, or accept some sort of configuration parameter to tell it which to use. This means that after running my effect code on your arbitrary div that was positioned usingright
andbottom
it will no longer be positioned relative to the bottom right as its relative container resizes.The issue of knowing if a CSS property is auto probably has more uses than just
left
andtop
. I could seewidth
andheight
also being useful to know if it is auto or specifically set.Specific Issues
right
andbottom
Specific Suggestions
isCSSAuto( property )
- Some method (be it on the computed style object, or somewhere else) could be provided to determine if a style property is auto before computation.right
andbottom
shouldn't returnauto
on a computed style object.The text was updated successfully, but these errors were encountered: