jquery-ui/tests/visual/animate/animate_color_rgb.html

35 lines
1.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<title>Animate Visual Test : Animate color rgb</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/jquery.effects.core.js"></script>
<script type="text/javascript">
function randomColorRGB() {
return 'rgb('
+ Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ')';
}
$(function() {
$("#go").click(function() {
$("#animate-color").stop().animate({ color: randomColorRGB() }, "fast");
});
})
</script>
<style type="text/css">
#animate-color { width: 250px; height: 100px; color: gray; }
</style>
</head>
<body>
<div id="animate-color">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</div>
<button id="go">Go</button>
</body>
</html>