zPath.js
A simple and easy to use plugin to draw any simple svg that uses only paths or any other elements but without fills.
Usage
You will need to include:
DEMO
Demo on Codepen
- DEMO.
###Initialization All you need to do is call the plugin inside a $(document).ready
function:
$(document).ready(function() { $('.demo').zPath(); });
A more complex initialization with all options set included could look like this:
$(document).ready(function() { $('.demo').zPath({ draw:'delayed', delay:20, shuffle:true, drawTime:1000 }); });
Options
-
draw
: (defaultdelayed
) the drawing style to use, other styles areall
,terminus
,terminusDelayed
,1by1
,2by2
,3by3
, ... ,10by10
,2by2Delayed
,3by3Delayed
, ... ,10by10Delayed
all
: will draw all the paths at onceterminus
: draws 2 paths at once, one is from the begining and the other one strats reversed from the endterminusDelayed
: the same asterminus
but it wont wait until the previous path has finished animating, instead it will start after thedelay
time has passed1by1
,2by2
. . .10by10
: let's say you will use4by4
this will draw 4 paths at the same time2by2Delayed
,3by3Delayed
... : this will draw the specific number of paths at the same time, but again it won't wait fot the other paths to finish, instead it will start after thedelay
has passed
-
drawTime
: (default1000
) the time that it will take for each path to draw -
delay
: (default20
) the delay between paths -
shuffle
: (defaultfalse
) if this istrue
it will shuffle the paths draw, looks good onterminusDelayed
ornbynDelayed
License
(The MIT License)
Copyright (c) 2015 Seviciu Cosmin / ZetCoby <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.