I want to make a div with transparent background smoothly changing color, the problem is that I need to have some content at the div which will not be transparent.
I found this for changing the color
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
setInterval ( "spectrum()", 1000 );
});
function spectrum(){
var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' +
(Math.floor(Math.random() * 256)) + ',' +
(Math.floor(Math.random() * 256)) + ')';
$('body').css( { backgroundColor: hue });
}
</script>
</head>
</body>
</html>
But I have no clue how to add the transparency into it.
The other thing I would like is to change the color by moving the with the cursor. I think it should be possible to combine it with the jQuery .mousemove()
function.
Thanks a lot