0
On the site there is a popup that in case should only appear when the person takes the mouse from the site area. But it was appearing when clicking a button that
jQuery('body').mouseleave(function() {
if (!jQuery('body').hasClass('leave-on') && localStorage.getItem("leave") != "closed") {
jQuery('body').addClass('leave-on');
}
});
So here at stackoverflow itself they helped me solve On this topic
But then I came across a new problem that still occurs with the same images or svg buttons. But now only happens in Firefox, and when you hover over such SVG the mouseleave is already fired, but in Chrome no.
Example of a SVG code that happens the problem:
<svg class="icon-blog"> <use xlink:href="#blog"></use> </svg>
In java script there is also this, which I don’t know if it might be causing the problem as well:
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
// the target node
if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
reusableSVGContainer = reusableSVGContainer ||
document.createElement('div');
reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
var svgNode = reusableSVGContainer.firstChild;
while (svgNode.firstChild) {
node.appendChild(svgNode.firstChild);
}
} else {
node.innerHTML = html;
}
});
The problem continues... If you want to see the site, it’s as follows: https://www.vanniksemijoias.com.br
– Celso Sá
I’ll take a look...
– Sam
Fixed the code. There was an error, I was using $ instead of jQuery
– Sam
Continued the problem with Firefox :s
– Celso Sá
Yeah, I really don’t know what to do. Can you believe I stayed up for hours trying this case of yours? I think in such cases the minimization of the problem is already worth it. Imagine that Firefox, despite being a very good browser, is well below Chrome in use. So leave it as it is and we can look for a definitive solution in time. I’ll even leave this question here scheduled to then dedicate a good time more to try to solve completely.
– Sam
Very obg for all the help, already helped a lot :) I will try to report the bug to Firefox to see if they identify the problem
– Celso Sá