Last active
January 31, 2018 23:36
-
-
Save ashsaraga/7e03725fbf0a2ad30287aecb927aa013 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 pinElement() { | |
var trigger = $('.trigger').offset().top; | |
$(window).scroll(function(){ | |
if($(window).scrollTop() > (trigger)){ | |
// function after trigger | |
} else { | |
// function before trigger | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment