Created
December 17, 2013 22:35
-
-
Save ascot21/8013893 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
$ -> | |
$(window).scroll -> | |
if $(window).width() > 640 | |
$widget = $(".sidebar-widget") | |
$position = $widget.offset().top | |
$breakPosition = $('.author-bio').offset().top | |
if ($(window).scrollTop() > $('.post-header').height()) && ($position < $breakPosition) | |
$widget.stop().animate marginTop: $(window).scrollTop() - $('header').height() - 155 | |
else | |
$widget.stop().animate marginTop: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment