Animating stroke on canvas with TweenMax.js
An example of animating stroke on canvas with TweenMax.js
12345678910111213141516171819202122232425262728<!DOCTYPE html>src="js/TweenMax.min.js"id="myCanvas" width="500" height="500"var context, canvas, myRectangle;canvas = document.getElementById('myCanvas');context = canvas.getContext('2d');function drawRectangle(myRectangle, context) {context.beginPath();context.rect(myRectangle.x, myRectangle.y, myRectangle.width, myRectangle.height);context.fillStyle = 'green';context.fill();context.lineWidth = myRectangle.borderWidth;context.strokeStyle = 'black';context.stroke();}