-
-
Save pavlo-bondarchuk/255c3f4c08645ea6a54d94eb841b2eca to your computer and use it in GitHub Desktop.
at-spectr
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
| jQuery(document).ready(function($){ | |
| var el = $('.realfactory-header-wrap'); | |
| var top = $(el).offset().top + $(document).scrollTop(); | |
| var el_height = $(el).height(); | |
| $(document).scroll(function(){ | |
| var scrollTop = $(document).scrollTop(); | |
| var $logo = $( '<div class="logo"></div>'); | |
| console.log(scrollTop); | |
| if ( scrollTop > el_height && !el.is('.highlighted') ){ | |
| $(el).addClass('highlighted'); | |
| $('.realfactory-container ').prepend($logo); | |
| console.log('highlighted add'); | |
| } | |
| if ( scrollTop < el_height && el.is('.highlighted')){ | |
| $(el).removeClass('highlighted'); | |
| $('.logo').remove(); | |
| console.log('highlighted remove'); | |
| } | |
| }); | |
| });q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment