cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <div id="ln1trigger">Click to animate line1 via jQuery</div>

<div id="ln2trigger">Click to animate line2 via CSS (needs support for transition)</div>


<svg width="687px" height="200px">

	<path id="line1" fill="none" stroke="#0000FF" stroke-width="5" stroke-miterlimit="10" d="M23.15,54.827
	<path id="line2" fill="none" stroke="#FF0000" stroke-width="5" stroke-miterlimit="10" d="M23.15,111.198


<a href="http://www.frontendfrontline.com/2013/10/animating-line-being-drawn-with-svg.html">Check out my blog</a>
              //with jQuery
	var ln1 = document.querySelector('#line1');

	jQuery('#ln1trigger').click(function() {
		var ln1length = ln1.getTotalLength();
		ln1.style.strokeDasharray = ln1length;
		ln1.style.strokeDashoffset = ln1length;

	//with CSS
	var ln2 = document.querySelector('#line2');

	jQuery('#ln2trigger').click(function() {
		var ln2length = ln2.getTotalLength();
		ln2.style.strokeDasharray = ln2length;
		ln2.style.strokeDashoffset = ln2length;
		ln2.style.webkitTransition = 'all 1s';
		ln2.style.transition = 'all 1s';
		ln2.style.strokeDashoffset = 0;

		ln2.addEventListener('transitionend', function() {
			ln2.style.strokeDashoffset = 0;
			ln2.style.webkitTransition = 'all 0s';
			ln2.style.transition = 'all 0s';	
Loading ..................