I have an image in SVG and when I have the mouse over the image make an alert and change the cursor to the hyperlink cursor. How can I do this?
<svg>
<image />
</svg>
I have an image in SVG and when I have the mouse over the image make an alert and change the cursor to the hyperlink cursor. How can I do this?
<svg>
<image />
</svg>
<svg class="element">
<image />
</svg>
.element:hover{
cursor:pointer;
}
Add the onmouseover event available in SVG components
SVG
<svg>
<image onmouseover="alert('Isso é um alert');"/>
</svg>
CSS
#svg-image:hover { cursor: pointer }
By using jQuery, you have the onHover function. Basically you have to do:
$(document).ready(function(){
$("image").hover(function(){
$(this).css( 'cursor', 'pointer' );
console.log("Estou em cima da imagem");
}
);
});