Guest User

Untitled

a guest
Aug 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <body>
  2. <div style="border: 1px solid red; width: 650px; height: 500px; margin: 0px auto; pointer-events: none; ;">
  3. <div class="frame" style="background-color: blue; -webkit-mask-image: url('./assets/Layer1.png'); z-index: 0"></div>
  4. <div class="frame" style="background-color: red; -webkit-mask-image: url('./assets/Layer2.png'); z-index: 1"></div>
  5. <div class="frame" style="background-color: grey; -webkit-mask-image: url('./assets/Layer3.png'); z-index: 2"></div>
  6. <div class="frame" style="background-color: yellow; -webkit-mask-image: url('./assets/Layer4.png'); z-index: 3"></div>
  7. </div>
  8.  
  9. <style>
  10. .frame {
  11. position: absolute;
  12. pointer-events: auto;
  13. width: 640px;
  14. height: 490px;
  15. padding: 1px;
  16. margin: 0px auto;
  17. box-sizing: border-box;
  18. }
  19. </style>
  20. </body>
  21.  
  22. let parent = document.getElementById('parent')
  23. parent.addEventListener('click', function() {
  24. parent.style.backgroundColor = event.target.style.backgroundColor;
  25. })
Add Comment
Please, Sign In to add comment