Created
June 17, 2020 13:35
-
-
Save IgorDePaula/3dfdd4ac2842ce212ac47f378a06b404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<style> | |
#painel{ | |
display: block; | |
background-color: #f00; | |
width:200px; | |
height:200px; | |
} | |
.maior{ | |
width:400px; | |
-webkit-transition: width 1s ease-in-out; | |
-moz-transition: width 1s ease-in-out; | |
-o-transition: width 1s ease-in-out; | |
transition: width 1s ease-in-out; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="painel"></div> | |
<button id="clicar">clicar</button> | |
<script> | |
let button = document.querySelector('#clicar') | |
button.addEventListener('click',e =>{ | |
let div = document.querySelector('#painel') | |
/* div.style.width = '400px'; | |
div.style.transition = ' width 1s ease-in-out'*/ | |
div.classList.add('maior') | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment