如何更改 Twitter Bootstrap 中警报消息淡入淡出的速度? [英] How can I change the speed of the fade for alert messages in Twitter Bootstrap?

查看:34
本文介绍了如何更改 Twitter Bootstrap 中警报消息淡入淡出的速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Twitter 引导程序,并且警报框关闭的淡出速度比我希望的要快.有什么地方可以改变淡入淡出的持续时间,或者甚至可以在每个警报的基础上设置它?

I'm using twitter bootstrap and the fade for the close on the alert box happens faster than I would like. Is there somewhere I can change the duration of the fade or perhaps even set it on a per alert basis?

谢谢

推荐答案

Dan Herman,

Dan Herman,

如果你没有使用 less 并且你想编辑 bootstrap.css,你可以尝试编辑这个,不要乱七八糟的 .js 文件.

If you're not using less and you feel like editing the bootstrap.css you may try and edit this one and not to mess around with the .js file.

编辑

 .fade {
   opacity: 0;
   -webkit-transition: opacity 0.25s linear;
      -moz-transition: opacity 0.25s linear;
       -ms-transition: opacity 0.25s linear;
        -o-transition: opacity 0.25s linear;
           transition: opacity 0.25s linear;
 }

把它变成...

 .fade {
   opacity: 0;
   -webkit-transition: opacity 1.25s linear;
      -moz-transition: opacity 1.25s linear;
       -ms-transition: opacity 1.25s linear;
        -o-transition: opacity 1.25s linear;
           transition: opacity 1.25s linear;
 }

1.25s 不是默认值,这只是一个例子,如果你应用它,你会真正注意到效果和差异.

1.25s is not the default value, that's is just an example and if you apply that, you'll really notice the effect and the difference.

现在,如果您想创建淡入淡出选择器的另一个变体,例如myFade",那么我认为您需要修改 bootstrap-alert.js 并添加新的类选择器或myFade"类选择器.

Now, if you want to create another variant of the fade selector, lets say, "myFade", then I think you need to modify the bootstrap-alert.js and add your new class selector or "myFade" class selector.

我还不了解 javascript.我只是觉得你需要修改 bootstrap-alert.js 并插入你的新类.

I don't know yet about javascript. I just thought you need to modify the bootstrap-alert.js and insert your new class.

这篇关于如何更改 Twitter Bootstrap 中警报消息淡入淡出的速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆