Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var achor = $('#about-ph').offset();
- var fixed = $('#selma');
- console.log(achor.top);
- $(window).on("scroll", function() {
- if ($(this).scrollTop() > achor.top) {
- $("#selma").css("position: fixed")
- } else {
- $("#selma").css("position: static")
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement