Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
的默认功能将.fadeIn()不透明度从 0 增加到 1。
.fadeIn()
我只是想知道是否有办法限制这一点。(比如说)将不透明度增加到 0.8 并且不超过该值。
尝试fadeTo()方法:
fadeTo()
$('#elem').fadeTo('slow', 0.8)
只需使用:.fadeTo(time, opacity)
.fadeTo(time, opacity)
$('#element')fadeTo(900, 0.7);
http://api.jquery.com/fadeto/
$('#element').fadeTo(1000, 0.8);
演示
可能您正在寻找动画功能效果?