Recently, I came across a code snippet that handles the visibility of a button using JavaScript. The code includes both HTML and JavaScript portions.
HTML
<div id="butStyle">
<button id="langBut">Language</button>
<button id="en"><img src="image/en.png" alt="en" height="20px" width="30px"></button>
</div>
JS
document.getElementById('en').style.display = 'none';
function displayONLang(){
document.getElementById('en').style.display = 'block';
}
function displayOFFLang(){
document.getElementById('en').style.display = 'none';
}
document.getElementById("butStyle").addEventListener("mouseover",displayONLang);
document.getElementById("butStyle").addEventListener("mouseout",displayOFFLang);
Now, my objective is to enhance this functionality by adding smooth animations through JavaScript. However, I am unsure about how to achieve this effect. Any advice or suggestions would be greatly appreciated!