Created
November 16, 2021 10:37
-
-
Save motsu0/72287e258a963fe0f70bfb6a52f1049e 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
<style> | |
#cont-10{ | |
z-index: 3; | |
clip-path: polygon(100% 0, 100% 0, 100% 0, 0 100%, 0 100%, 0 100%); | |
transition: clip-path 1s; | |
} | |
#cont-10.moved{ | |
clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%, 0 100%, 0 0); | |
} | |
</style> | |
<div id="trans-10" class="cont-outer"> | |
<div class="cont contA">A</div> | |
<div class="cont contB" id="cont-10">B</div> | |
</div> | |
<script> | |
document.getElementById('trans-10').addEventListener('click',()=>{ | |
document.getElementById('cont-10').classList.toggle('moved'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment