Skip to content

Instantly share code, notes, and snippets.

@henrycat
Created August 23, 2015 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrycat/8cf79a4d51ef364fa25b to your computer and use it in GitHub Desktop.
Save henrycat/8cf79a4d51ef364fa25b to your computer and use it in GitHub Desktop.
NqQKMY
<button>Click Here</button>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
$(document).ready(function() {
$("button").on("click", function() {
$("ul").toggle(500, function() {
$("li:nth-child(1)").delay(1000).fadeIn(1000, function() {
$(this).css("color", "green");
});
$("li:nth-child(2)").delay(2000).fadeIn(1000, function() {
$(this).css("color", "blue");
});
$("li:nth-child(3)").delay(3000).fadeIn(1000, function() {
$(this).css("color", "purple");
});
});
});
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
button {
background-color:red;
color:white;
padding: 20px;
}
ul {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment