Skip to content

Instantly share code, notes, and snippets.

@vtsatskin
Last active December 11, 2015 08:08
Show Gist options
  • Save vtsatskin/4570648 to your computer and use it in GitHub Desktop.
Save vtsatskin/4570648 to your computer and use it in GitHub Desktop.
MadeInWaterloo company cell hover animation. Requires jQuery
.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; } }
$(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