Guest User

Untitled

a guest
Sep 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. trigger hover behaviour for multiple layers of elements
  2. <img class="Image" src="./img/foo.png">
  3.  
  4. .Image {
  5. opacity: 0;
  6. }
  7.  
  8. $(".CircleImage").hover(
  9. function() {
  10. $(this).fadeTo(0,1); // mouseenter
  11. },
  12. function() {
  13. $(this).fadeTo(200,0); // mouseleave
  14. }
  15. );
  16.  
  17. <span class="imgContainer">
  18. <a href="#">X</a>
  19. <img class="Image" src="./img/foo.png" width="100" height="100">
  20. </span>
  21.  
  22. .imgContainer {
  23. opacity: 0.1;
  24. width: 100px;
  25. height: 100px;
  26. }
  27.  
  28. .imgContainer a {
  29. position: absolute;
  30. }
Add Comment
Please, Sign In to add comment