Created
February 6, 2014 20:04
-
-
Save tourdedave/8851561 to your computer and use it in GitHub Desktop.
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
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script src="/js/waypoints.min.js"></script> | |
<script> | |
$(function() { | |
var promo = $('#promo'), | |
speed = 500; //speed in ms | |
$('.promo-hook').waypoint(function(direction){ | |
if (direction === "down") { | |
promo.slideDown(speed); | |
} | |
if (direction === "up") { | |
promo.slideUp(speed); | |
} | |
}, { | |
offset: function() { | |
return -$(this).height(); | |
} | |
}); | |
$('#close').click(function(){ | |
promo.slideUp(speed,function(){ | |
promo.remove(); | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment