开发者

animate from display block to display inline

开发者 https://www.devze.com 2023-03-31 14:25 出处:网络
Is it possible at all to use jquery or jquery ui to animate an unordered list from display block to display inline. So the list will sm开发者_如何学JAVAoothly transform to inline?Yes, it\'s possible.

Is it possible at all to use jquery or jquery ui to animate an unordered list from display block to display inline. So the list will sm开发者_如何学JAVAoothly transform to inline?


Yes, it's possible. No, there isn't a nice, simple, built-in way.


Such a call to animate() would be valid. But which result may we expect? Animation of "top" from 0 to 1000 in 100 steps increases top by 10 each step. What are the "steps" /"slices" between block and inline?


I know this is a very old question but for people who are looking at this thread, you can add a custom animation to the block property now.

.subnav-is-opened .main-nav__secondary-nav {
   display: block;
   -webkit-animation: showNav 250ms ease-in-out both;
   -animation: showNav 250ms ease-in-out both;
 }

/* Chrome, Safari, Opera */
@-webkit-keyframes myfirst {
    from {opacity: 0;}
    to {opacity: 1;}
}

Demo - https://developers.google.com/web/fundamentals/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号