Shadow artifacts during animation in IE9

后端 未结 5 2175
天涯浪人
天涯浪人 2021-02-19 15:59

Here are css, html and js to reproduce:

html:

123
345
5条回答
  •  臣服心动
    2021-02-19 16:45

    Attempt #1

    http://jsfiddle.net/DwApF/3/

    This hides the shadow and then restores it after the slide is complete. It's a hack of a solution but this is a manner in which a variety of behaviors can be circumvented.

    Attempt #2

    http://jsfiddle.net/DwApF/11/

    This does a simultaneous animation of both outer and inner containers. It slides the drop shadow with no artifacts. However, you will need to manually manipulate the height of the outer container, and also deal with hiding the contents of the inner container. It does eliminate the artifact issue though.

    Attempt #3 - My Preferred Solution

    http://jsfiddle.net/DwApF/12/

    This still uses a simultaneous animation of both outer/inner containers. I see no artifacts in IE9. It also handles hiding the inner container's content using overflow: hidden.

    The sizing of the outer container still must be done manually, but I think this is an adequate solution. There should be a way to determine the collapsed height using jQuery so that this value doesn't need to be hard-coded.

    This solution works in IE9, Chrome, and Firefox. Note that I have added some colors/borders so that it's easier to see the different containers.

提交回复
热议问题