Skip to content

Instantly share code, notes, and snippets.

@masuhajime
Created April 11, 2015 08:08
Show Gist options
  • Save masuhajime/756cd6918a1f735dfd4e to your computer and use it in GitHub Desktop.
Save masuhajime/756cd6918a1f735dfd4e to your computer and use it in GitHub Desktop.
fadeIN/Out rotation
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
function rotate(){
$('#catch1').fadeIn(500, function() {
$(this).fadeOut(500, function() {
$('#catch2').fadeIn(500, function() {
$(this).fadeOut(500, function() {
$('#catch3').fadeIn(500, function() {
$(this).fadeOut(500, function() {
$('#catch4').fadeIn(500, function() {
$(this).fadeOut(500, function() {
rotate();
});
});
});
});
});
});
});
});
}
$(function(){
rotate();
})
</script>
<style type="text/css">
p{
display:none;
}
</style>
<p id="catch1">catch1</p>
<p id="catch2">catch2</p>
<p id="catch3">catch3</p>
<p id="catch4">catch4</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment