Last active
October 30, 2015 20:27
-
-
Save theskillwithin/6fb7652e82fb3cf7c46e to your computer and use it in GitHub Desktop.
ysw team covers js
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 checkOffset() { | |
var myElement = $( "#caption center" ).find('select').parents('center'), | |
test = myElement.offset().top - $(window).scrollTop(); | |
if (test < 0) { | |
myElement.addClass('.stickytop'); | |
} else { | |
myElement.removeClass('.stickytop'); | |
} | |
} | |
} | |
if ($( "#caption center" ).length != 0) { | |
checkOffset(); | |
$(window).resize(checkOffset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment