update transition-duration

This commit is contained in:
jljsj 2015-11-23 15:39:55 +08:00
parent 64be14e89e
commit 8026a92974
2 changed files with 12 additions and 2 deletions

View File

@ -33,12 +33,19 @@ export function getTranslateY(differ, data, _data, height, i) {
return false;
}
//判断相差的位数来驱动数字差个位滚动一格差10的部分及以上个位滚动一周
/*
* 区域段
* 0-9:0
* 0-9:1
* 0-9:2
* */
const countToString = Math.abs(differ).toString();
const countLength = countToString.length;
const on = _data[i];
const to = data[i];
if (differ > 0) {
if (countLength - 1 > i) {
//差值位数大于1时参数的位置到达减去两个参数的差在0区域段
translateY = -(to - (to - on)) * height;
//on大于to且differ大于10如9->0,需要设计滚动到的位置10;
if (on > to) {
@ -53,10 +60,12 @@ export function getTranslateY(differ, data, _data, height, i) {
} else {
//如果开始大于到达到达to加10
const _to = on > to ? to + 10 : to;
//差值为一位数时到达减去两个参数的差在1区域段加10
translateY = -(to - (_to - on) + 10) * height;
}
} else {
if (countLength - 1 > i) {
//差值位数大于1时参数的位置到达加上两个参数的差在2区域段加20需要滚动一周
translateY = -(to + (on - to) + 20) * height;
//同上differ大于10时且to在于on
if (to > on) {
@ -65,7 +74,9 @@ export function getTranslateY(differ, data, _data, height, i) {
} else if (countLength - 1 < i && to === on) {
translateY = null;
} else {
//如果到达大于开始,开始(on)加10;
const _on = on < to ? on + 10 : on;
//差值位数小于1时参数的位置到达减去两个参数的差在1区域段加10往上滚回差值
translateY = -(to + (_on - to) + 10) * height;
}
}

View File

@ -67,8 +67,7 @@ a .@{badge-prefix-cls} {
overflow: hidden;
&-only{
display: inline-block;
transition: transform 1.3s @ease-in-out;
transition: transform .3s @ease-in-out;
}
}