Answer the question
In order to leave comments, you need to log in
How to intercept clicks on elements of an SVG file using jQuery?
Good afternoon, is it possible to intercept clicks on objects of the SVG file
Namely, the page displays the SVG file using the html method (or not the essence)
This file is a set of all kinds of different polygons, each polygon has its own ID
The simplest example of what needs to be done is when clicking on any of the elements, alert its ID.
I
found an article about this https://blog.mimacom.com/blog/2017/04/27/how-to-cr...
my svg does not respond to clicks
Answer the question
In order to leave comments, you need to log in
$string = '.carousel-fade .carousel-item-next.carousel-item-left, .carousel-fade .carousel-item-prev.carousel-item-right, .carousel-fade .carousel-item.active {';
$prefix = '#elements';
$references = explode(', ', $string);
echo $prefix . ' ' . implode($prefix, $references);
As with html code: assign a class or ID to svg elements. Or by tag name. There's a path, it seems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question