SVG Path Painter

Examples

Paint on page load

Simply call $('#mySVG').SVGPathPainter(); to get your paths painted directly on page load.

Paint on custom call


Initialize the plugin with
mySVG = $('#mySVG').SVGPathPainter({ initialDelay: false });
to prevent initial painting.

When desired, call mySVG.SVGPathPainter('paint'); to paint the paths.

Attach plugin to several SVGs


Like most jQuery Plugins, you can also call this one with a selector matching more than one element, e.g.
$('#svg-1, #svg-2').SVGPathPainter();
This results in painting paths at the same time.

Usage of options



There are a few options you can use when initializing the plugin.

initialDelay (default: 300) means the milliseconds the painting is delayed from page load. Set to false if you wish no initial animation.
pathDelay (default: 50) defines the milliseconds of pause between the animation of two paths.
speed (default: 1.5) is a factor to slow down (or accelerate if < 1) the speed of a path being painted.

Compare the animation of the SVGs here. The left one uses defaults, the right one uses pathDelay: 500 and speed: 3.2.