【问题标题】:How to reverse transition?如何反向过渡?
【发布时间】:2017-05-21 05:34:22
【问题描述】:

我有一个从 height:0, width:0 到某个宽度的过渡。它工作正常,从左下角到右上角。现在我想如果我将浮动更改为“右”,则转换将从右下角到左上角。有什么方法可以进行这种过渡吗?

css:

.ablauftext{
    height:0;
    width:0;
    position:absolute;
    overflow:hidden;
    background-color:white;
    transition: all 1s ease;
    -webkit-transition: all 1s ease;    
    bottom:90px;
}

.active{
    height:400px;
    width:400px;    
}

javascript:

$('#planung').click(function(){
    if(!$current.is('#planungtext')){
        $($current).removeClass('active');
        setTimeout(function(){$('#planungtext').addClass('active')}, 1000);
        $current = $('#planungtext');
    }
});

我的元素上只有浮点数的 ID,所以我认为我不必在此处添加此 CSS。

【问题讨论】:

    标签: css transition


    【解决方案1】:

    它现在可以工作了,我只需要添加一个正确的位置,就像这样:

    .yourdiv{
       right:anyamount;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-27
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      • 1970-01-01
      • 2015-07-15
      • 1970-01-01
      • 2021-08-27
      相关资源
      最近更新 更多