I am working on a web application and I want to have the effect " http://jquery.vostrel.cz/reel .
I want to create this effect using canvas / div instead of images. Has anyone tried this before?
Edit
The code I tried looks like this.
<body> <canvas width="1280" height="720" id="pageCanvas"> You do not have a canvas enabled browser </canvas> <script> var context = document.getElementById('pageCanvas').getContext('2d'); var angle = 0; function convertToRadians(degree) { return degree*(Math.PI/180); } function incrementAngle() { angle++; if(angle > 360) { angle = 0; } } function drawRandomlyColoredRectangle() { <!-- clear the drawing surface --> context.clearRect(0,0,1280,720); incrementAngle(); context.save(); context.lineWidth = 10; context.translate(200,200); context.rotate(convertToRadians(angle)); context.fillStyle = '#'+Math.floor(Math.random()*16777215).toString(16); context.fillRect(-25,-25,50,50); context.strokeRect(-25,-25,50,50); context.restore(); } setInterval(drawRandomlyColoredRectangle, 20); </script> </body>
This I tried to use one Canvas, but I want to use several Canvas.
Please help me solve this problem ....
source share