0
Error with exit button
hello everyone, going straight to the point, when I place the mouse over the svg, the correct thing would be the text appear, but it doesn't. I would like to know the solution, thanks :) https://code.sololearn.com/W6cN1eNPyNiR/?ref=app
1 Odpowiedź
+ 1
Change your JavaScript to:
var exit = document.getElementById("exitA");
var exitB = document.querySelector(".exitButton");
exitB.onmouseover = function(){
exit.style.transform = "translateX(0)";
}
exitB.onmouseout = function(){
exit.style.transform = "";
}
I made the text disappear when moving the cursor away. If you don't like that, just remove the onmouseout code.
Something like that can be achieved with CSS and a :hover selector.
The following CSS will cause the hover to toggle like the JavaScript above does:
.exitBox:hover #exitA {
transform: translateX(0);
}