How can I target a class or multiple SVG's on 1 page?
See original GitHub issueAny examples of this? I read that you can target an ID or object but don’t quite understand how to do that. When I try it with ID it only does the first one and then stops. This is my attempt at trying to get it to do class.
jQuery(function () {
var myCallback;
var myElement = document.getElementsByClassName("icon-vivus");
new Vivus(myElement, {duration: 50, type: 'async' }, myCallback);
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Multiple SVGs on a page - Stack Overflow
var img = document.getElementById ; "svg1"); // get the SVG document inside the img tag var ; contentDocument; // get that circle item...
Read more >Best Practices for Working with SVGs - Bitovi
In your favorite vector program, start by naming the main layer group for your SVG (e.g. "avatar-female-left"). Naming this layer will create a ......
Read more >class - SVG: Scalable Vector Graphics - MDN Web Docs
Assigns a class name or set of class names to an element. You may assign the same class name or names to any...
Read more >The Many Ways to Link Up Shapes and Images with HTML ...
The only trick here is to make sure the <a> tag is inside the SVG markup and that the tag wraps the shape...
Read more >Styling And Animating SVGs With CSS - Smashing Magazine
Working with inline SVG and CSS is a lot easier because the SVG can be styled and animated by targeting it with style...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Back on my computer, I can write a snippet 😃
Sorry for the delay, xmas and stuff… Well played for finding a solution yourself. I’m just scared about optimization if a second click is triggered. Because it will recreate objects and reload SVG… it’s consuming a lot. What I recommend you is to create objects first, then play it when needed.
I hope it’s clear, I’m bad to explain things sometimes. 😃