A Pen by erikpantzar on CodePen.
Created
December 9, 2014 11:54
-
-
Save erikpantzar/da4313682d6d9f7521cd to your computer and use it in GitHub Desktop.
product-item-presentation
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
<div class="product-item"> | |
<img src="" class="product-item-image" alt="" /> | |
<h2 class="product-item-title"> PL01 Men’s Pullover </h2> | |
<div class="product-item-layer"> | |
<div class="product-item-excerpt"> | |
<p><strong>Produktkod:</strong> PW04</p> | |
<p>Modern passform<br> | |
Förstärkt nacksöm<br> | |
Snygga detaljer</p> | |
<p><strong>Passar:</strong> Både på jobb och fritid.</p> | |
</div> | |
<a class="ghost-button" href="#">Visa artikel</a> | |
<a class="ghost-button" href="#">Lägg till som favorit</a> | |
</div> | |
</div> |
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
$('.product-item').on('click', function() { | |
$(this).toggleClass('active'); | |
}); |
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
@import "compass/css3"; | |
p { margin: 0 0 15px; font-family: sans-serif; font-size: 1em; line-height: 1.5; } | |
strong { font-weight: 700; } | |
.product-item { width: 300px; height: 400px; background: white; border: 2px solid black; } | |
.product-item-image { | |
background: red; | |
width: 300px; | |
height: 400px; | |
} | |
.product-item-excerpt { | |
display: block; | |
} | |
.product-item {position: relative;} | |
.product-item.active .product-item-layer { display: block; } | |
.product-item-layer { | |
display: none; | |
background: white; | |
position: absolute; | |
background: green; | |
padding: 20% 10%; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
} | |
.product-item-layer .ghost-button { | |
margin: 0 auto 10px; | |
max-width: 200px; | |
} | |
.ghost-button { | |
background: none; border: 1px solid; | |
padding: 8px 12px; | |
text-decoration: none; | |
width: 100%; | |
display: block; | |
text-align: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment