微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 过渡缓和,从右到左,如何?

缓和通常从左向右移动,现在我想从右向左改变它
如何在CSS中设置它?

例如:

transition:         background-position 150ms ease-out;
-moz-transition:    background-position 150ms ease-out;
-webkit-transition: background-position 150ms ease-out;
-o-transition:      background-position 150ms ease-out;

解决方法

transition属性没有认方向.缓和只是 transition timing function

Spec

The transition-timing-function property describes how the
intermediate values used during a transition will be calculated. It
allows for a transition to change speed over its duration. These
effects are commonly called easing functions. In either case,a
mathematical function that provides a smooth curve is used.

背景位置转换的方向取决于第一个和最后一个值.

例如:

.Box {
    /* other styles here... */
    background-image: url(http://lorempixel.com/500/300);
    transition: background-position 150ms ease-out;
}

/* Move the background image from right to left */
.Box.rtl { background-position: 0 center; }
.Box.rtl:hover { background-position: 100% center; }

/* Move the background image from left to right */
.Box.ltr { background-position: 100% center; }
.Box.ltr:hover { background-position: 0 center; }

WORKING DEMO.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。