A Pen by Ryan Underdown on CodePen.
Created
July 14, 2020 20:31
-
-
Save underdown/44ef428a1b9b7d5890695d125d213fa2 to your computer and use it in GitHub Desktop.
playing with overlays
This file contains hidden or 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
<div ID="container"> | |
<div class="highlight hidden"></div | |
</div> |
This file contains hidden or 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
$(document).ready(function() { | |
$("#container").click(function() { | |
$("#container .highlight").toggleClass("hidden"); | |
console.log("container clicked"); | |
}); | |
}); |
This file contains hidden or 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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> |
This file contains hidden or 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
#container {max-width:560px;margin:auto;background-image:url("https://classyclosets.com/lp/images/price-1.jpg");border:1px solid #000000;height:400px} | |
.highlight {height:100%;width:100%;background-image:url("https://classyclosets.com/lp/images/price-2.png" );background-cover:cover;} | |
.hidden {display:none;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment