An open API service indexing awesome lists of open source software.

https://github.com/mberneti/jquery-svg

A jQuery plugin to apply css styles and js scripts to a SVG which is embedded (using the <object> tag).
https://github.com/mberneti/jquery-svg

jquery jquery-plugin jquery-svg js svg

Last synced: 8 months ago
JSON representation

A jQuery plugin to apply css styles and js scripts to a SVG which is embedded (using the <object> tag).

Awesome Lists containing this project

README

          

# jquery-svg
A lightweight jQuery plugin to apply css styles and js scripts to a SVG which is embedded (using the <object> tag).
## Usage

1. Include jQuery:

```html

```

2. Include plugin's code:

```html

```

3. Call the plugin:

```javascript
window.onload = function(){

//apply embed css to the svg object
$("#cars").setSVGStyle(style);
//or
//apply css by stylesheet link
$("#cars").setSVGStyleLink(stylepath);

//get svg object, like a jquery object
var svg = $("#cars").getSVG();
//use jquery functions to do some thing
svg.find("g path:first-child()").attr('fill', color);

};
```

## Demo
- [test with embed css](http://mberneti.github.io/jquery-svg/)
- [test with linked css](http://mberneti.github.io/jquery-svg/test-linked-css.html)