-1
I’m starting studies with SVG and trying to understand an example I can not run it correctly, the HTML/CSS/JS parts were demonstrated and I made the connection of these parts, but it didn’t work... If anyone can tell me what I’m doing wrong it would be very helpful:
<html>
<head>
<title>Exemplo Teste</title>
<style>
.meu-circulo {
r: 30;
cx: 50;
cy: 40;
fill: lightgreen;
stroke: orange;
stroke-width: 5;
transition: all 1s ease;
}
.meu-circulo:hover {
cx: 70;
fill: green;
stroke-width: 10;
}
</style>
<script>
const circle = document.querySelector('.meu-circulo');
let r = 30;
circle.addEventListener('click', () => {
r += 10;
circle.style.r = r;
})
</script>
</head>
<body>
<svg>
<circle class="meu-circulo"></circle>
</svg>
</body>
</html>
But what didn’t work??
– hugocsl
Do not draw the circle and apply the JS effect of increasing the radius with the click event
– Rei Motta