0.1.4 • Published 8 years ago

jquery-svg-to-inline v0.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

jQuery SVG to inline

Build Status Coverage Status Dependencies Status NPM Downloads Github Release Github Issues Github License

A jQuery plugin to replace and embedding SVG inline.

Table of Contents

Examples

<object class="svg myClass" type="image/svg+xml" data="htts://somesvg.svg"></object>

or

<img src="https://somesvg.svg"  class="svg myClass otherClass">

Will generate

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="myClass otherClass">
  <circle cx="50" cy="50" r="50"/>
</svg>

Usage

$( ".svg" ).svgToInline();

Options

useTriggerClass

By default the trigger class will isn't used on inline svg. If you want use set to true.

$( ".svg" ).svgToInline({useTriggerClass: true});
Example
<img src="https://somesvg.svg"  class="svg myClass otherClass">

Will generate

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="svg myClass otherClass">
  <circle cx="50" cy="50" r="50"/>
</svg>

License

Jquery SVG to inline is released under the terms of the MIT license.