New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

drawsvg

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drawsvg

Lightweight, simple to use jQuery plugin to animate SVG paths

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54
decreased by-27.03%
Maintainers
1
Weekly downloads
 
Created
Source

jQuery DrawSVG

This plugin uses the jQuery built-in animation engine to transition the stroke on every <path> inside the selected <svg> element, using stroke-dasharray and stroke-dashoffset properties.

  • Weights less than 2KB minified and 800 bytes gzipped.
  • Easy to use.
  • Easing and stagger support.
  • Free!

Usage

Include jQuery DrawSVG after jQuery

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="jquery.drawsvg.js"></script>

Initialize the plugin on the element you want to animate and store in a variable

var mySVG = $('#my_svg_element').drawsvg();

Run the animation

mySVG.drawsvg('animate');

Look at the demos for more advanced usages.

Options

OptionTypeDefaultDescription
durationInteger1000The time to complete the animation of each path.
staggerInteger200Delay to start animating each individual path.
easingStringswingWhich easing function each path will use to transition.
Use jQuery Easing Plugin for different easing functions.
reverseBooleanfalseDirection that the line will be drawn.
callbackFunctionfunction() {}A function to call once the animation has been completed.

Demos

Simple usage

Draw on scroll

Callback example

Animate mask path

Keywords

FAQs

Package last updated on 05 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc