Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
function cycle_colors($item){
var colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'white']
$.each(colors, function(i, current_color){
$item.animate({color:current_color}, 800)
})
}
</script>
<h1 class="example">Example</h1>
<a onclick="cycle_colors($('.example'))" href='#'>cycle</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.