Skip to content

Instantly share code, notes, and snippets.

@zetter
Created April 4, 2010 10:53
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 zetter/355314 to your computer and use it in GitHub Desktop.
Save zetter/355314 to your computer and use it in GitHub Desktop.
<!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