CSS animation won't work with 'overflow: hidden;'

前端 未结 2 1717
感情败类
感情败类 2021-01-12 17:30

I would appreciate if someone could point me into the right direction by telling me what I\'m doing wrong. Please look at this example. As you can see I\'m trying to move \'

相关标签:
2条回答
  • 2021-01-12 18:07

    Another trick could be moving overflow: hidden to the animated element:

    http://jsfiddle.net/GLdQs/9/

    #id1 {
        width: 0px;
        overflow: hidden;
    }
    
    #id1 > p {
        width: 500px; /* you probably want a fixed width for the content  */
    }
    
    @-webkit-keyframes slide {
      0%   { left: 500px; top: 0px; width:   0px; }
      100% { left:   0px; top: 0px; width: 500px; }
    }
    
    ​
    
    0 讨论(0)
  • 2021-01-12 18:14

    He can help you, if you are in trouble:

    http://jsfiddle.net/GLdQs/8/

    .container {
        /* overflow: hidden; */
        clip: rect(auto, auto, auto, auto);
    }
    

    Unfortunately it shows the horizontal scroll bar.

    0 讨论(0)
提交回复
热议问题