IE 9 and 10 box-shadow on resizing element

£可爱£侵袭症+ 提交于 2019-12-03 13:18:14

(I realise that this answer is a bit late, but I think it's worth documenting a working solution/workaround.)

I had a similar problem recently. The solutions seems to be add an additional <div> tag below the one with the box shadow. Make sure that there is no margin between these two <div>s and that the height is at least as high as the height of the bottom shadow and the width as wide as the shadow. This seemed to force IE to repaint the area where the shadow used to be when the bottom <div> moves up.

In your case, I added left and right margins to the <div>with the box shadow as well as adding the "shadow-fix" <div>. You can see the new version here: http://jsbin.com/ararar/51/edit

Hope that helps you or someone else.

I took the solution from Andy but instead of putting an empty element in the markup, I simply added an empty CSS pseudo-element on the parent (the one with the shadow, not the resized element).

.shadowed-element:after { content: ""; }

Works perfectly with animated height in jQuery, repainting during the animation and not only at the end. Thanks Andy for putting me on the right track !

I added this css so that the browser new how much height it was removing, is it working for you now?

css

#resizing ul li {
 line-height:1em;
 height:1em;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!