After writing the following jQuery script, I encountered an issue.
<script type="text/javascript">
$(document).ready(function(){
$('#Oval-1').on('mouseover', function(e) {
$("#Oval-1").fadeOut();
});
$('#Oval-1').on('mouseout', function(e) {
$("#Oval-1").fadeIn();
});
});
</script>
The ID Oval-1 corresponds to an SVG image on my webpage. The intention was for the image to fade out upon mouseover and fade back in upon mouseout. However, the current implementation is causing the image to blink once. What am I missing here?
Displayed below is the div containing the SVG:
<div class="wrapper">
<svg width="1024px" height="279px" viewBox="0 0 1024 279" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 3.6.1 (26313) - http://www.bohemiancoding.com/sketch -->
<title>map png</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="geschichte" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop-Landscape" transform="translate(-145.000000, -332.000000)">
<g id="map" transform="translate(107.000000, 246.000000)">
<g id="mapback" transform="translate(38.000000, 86.000000)">
<g id="map-png">
// Additional paths found within the SVG have been omitted
<ellipse id="Oval-1" fill="#0B619B" opacity="0.141849347" cx="929.5" cy="94.5" rx="94.5" ry="94.5"></ellipse>
</g>
</g>
</g>
</g>
</g>
I came across this solution, but my concern lies specifically with jQuery rather than vanilla JavaScript.