fid:https://jsfiddle.net/k13sazuz/
如何在jQuery中使用css规则链接延迟?
$('.two').css('background','blue').delay(11800).css('background','red');
.two{
height:100px;
width:300px;
background:blue;
}
.ok{
display:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="ok">hey</div>
<div class="two"></div>
答案 0 :(得分:-1)
$.fn.delayCss=function(Time,Name,Value){
var This=this;
setTimeout(function(){
This.css(Name,Value);
},Time);
return this;
};
$('.two').delayCss(1000,'background','red');