Answer the question
In order to leave comments, you need to log in
jquery and svg and accordeon plugin?
The gist is this:
There are five tabs created with the Accordeon plugin in juqery ui, each containing one svg. I manage them with jquery. The first svg is managed without problems, while the svgs on the rest of the tabs are not responsive. Moreover, when switching back to the first tab, the svg contained in it also does not respond to events. And in the console elements are recognized normally. Please help. I am attaching the code.
function stages(index) {
if (!index) {
index == 0;
}
svgobject = document.getElementById('imap'+index);
svgdom = jQuery(svgobject.contentDocument);
$("g, path", svgdom).css({"transition":"1s","cursor":"pointer"});
$("path", svgdom).css({"fill":"red","opacity":".3"});
$("g, path", svgdom).click(function(){
id = $(this).attr("id").slice(4)
$(".lje[href="+id+"]") .click();
});
}
Answer the question
In order to leave comments, you need to log in
I'll answer myself.
JS doesn't see SVG in block with display:none;
I had to go with crutches, but now everything works. I hide the blocks, and when clicked, I display:
.ui-tabs [aria-hidden=true] {
position: absolute;
display: block !important;
left: -10000px;
height: 0;
}
.ui-tabs [aria-hidden=false] {
position: relative;
display: block !important;
left: initial;
height: initial;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question