0

fid: https://jsfiddle.net/k13sazuz/

How do I chain delay with css rules in jQuery?

$('.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>

2

1 Answer 1

-1
$.fn.delayCss=function(Time,Name,Value){
var This=this;
setTimeout(function(){
This.css(Name,Value);
},Time);
return this;
};
$('.two').delayCss(1000,'background','red');
Sign up to request clarification or add additional context in comments.

1 Comment

You should add an explanation of how this works as well

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.