Last active
December 11, 2015 08:08
-
-
Save vtsatskin/4570648 to your computer and use it in GitHub Desktop.
MadeInWaterloo company cell hover animation. Requires jQuery
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
.cell { | |
position: relative; | |
height: 125px; | |
margin-bottom: 20px; | |
background: white; | |
border-top-width: 0.5em; | |
border-top-style: solid; | |
text-align: center; } | |
@media (min-width: 1200px) { | |
.cell { | |
margin-bottom: 30px; } } | |
.cell .hiring { | |
position: absolute; | |
z-index: 3; | |
left: 0.5em; | |
top: 0.5em; } | |
.cell .logo { | |
z-index: 2; | |
position: absolute; | |
background: #eeeeee; | |
width: 100%; | |
overflow: hidden; } | |
@media (max-width: 767px) { | |
.cell .logo { | |
width: 50% !important; } } | |
.cell .logo a { | |
display: block; | |
width: 100%; | |
line-height: 9em; } | |
@media (max-width: 767px) { | |
.cell .logo a { | |
line-height: 6em; } } |
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
$(function(){ | |
function isMobile() { return $(window).width() <= 767 } | |
$(".cell").hover(function(){ | |
if(!isMobile()) | |
$(this).children('.logo').animate({width: '50%'}, 250); | |
}, function(){ | |
if(!isMobile()) | |
$(this).children('.logo').animate({width: '100%'}, 250); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment