Raphael是一个轻量级的跨浏览器绘制矢量图的JavaScript库。在支持SVG的浏览器上使用SVG,在不支持SVG的浏览器上使用VML。Raphael支持Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ 和 Internet Explorer 6.0+。
如下是一个演示:
var paper = Raphael("raphaelHolder1");
paper.circle(80,80,50).attr({"fill":"#F00","stroke-width":2}).hover(function(){
this.animate({scale: [1.3, 1.3, this.cx, this.cy]}, 500, "bounce");
},function(){
this.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce");
});