box-sizing-polyfill icon indicating copy to clipboard operation
box-sizing-polyfill copied to clipboard

Handle resizes on parent element

Open kapitancho opened this issue 11 years ago • 3 comments

This change handles an issue with the box-sizing polyfill. If there is an element X with box-sizing = content-box and it has a child element Y with box-sizing = border-box, if the dimensions of X change, the dimensions of Y are not updated. The proposed fix attaches an "onresize" event to the corresponding parent element and the issue is resolved.

kapitancho avatar Mar 11 '13 17:03 kapitancho

hi,kapitancho nice code....
I 'm puzzled about the code works on ie6.... after size of the element's parent changed,the update function will throw a exception about "element......" so i have to add a param to hold the original element.... and it works well on ie 7 ... Can you tell me some thing about this problem?

lsjwzh avatar Mar 18 '13 15:03 lsjwzh

Hello lsjwzh, when I test on my IE6, I have no JavaScript errors. What is the exact exception that you get?

kapitancho avatar Mar 18 '13 16:03 kapitancho

Hello ,kapitancho Thanks for your reply

The problem happened about a month ago in an old project...i cannot remember the exact info.....and it seems not happen on all ie 6 machine,.....
i guess the reason is that i used element.onResize instead of attachEvent,that makes update function run in an error context.... if i get it , i will send it to you as soon as possible....

lsjwzh avatar Mar 19 '13 10:03 lsjwzh