CSS转换 - 在不改变时序的情况下更改属性

时间:2016-11-18 16:52:12

标签: javascript jquery css

我使用CSS过渡旋转图像

create table TEST ( Number int, c1 char(1), c2 char(1),  c3 varchar(4));

insert into TEST
      select   325, 'A', 'K', 'NFW'
union select   325, 'U', 'G', 'GFD'
union select 32713, 'A', 'K', 'fgh'
union select  3271, 'U', 'G', 'ghad'
union select   327, 'A', 'G', 'yrg'
union select  3277, 'A', 'K', 'bfb'


select *
from TEST
inner join
(
    select Number
    from TEST
    group by Number
    having count(Number) = 1
) X on TEST.Number = X.Number

用jQuery触发它

img {
    transition:all 5s ease-out;
}

在旋转过程中的某些点(随机)我想改变旋转的方向。图片应继续当前宽松和当前持续时间。这可能吗?

1 个答案:

答案 0 :(得分:1)

你尝试过这样的事吗?

div {
  background: red;
  width: 100px;
  height: 100px;
  transition: all 5s ease-out;

}

div.rotateRight {
  transform: rotate(200deg);
}

div.rotateLeft {
  transform: rotate(-200deg);
}

$('div').addClass('rotateRight');

setTimeout(function() {
  $('div').addClass('rotateLeft');
},4000);

https://jsfiddle.net/o3pg8d1d/