C
C
Chokatillo2017-09-02 11:48:15
JavaScript
Chokatillo, 2017-09-02 11:48:15

After adding the script, some other scripts do not work?

After adding this:

var $block = $('#lk-conteyner'),
    blockPos = $('#lk-conteyner').offset().top;
$(window).scroll(function(){
  var currentScroll = $(this).scrollTop();
  		console.log(currentScroll);
     if ( currentScroll > blockPos ) {
     		$block.slideUp(200);
     } else {
     		$block.slideDown();
     }
});


Scripts like this one don't work:

$(window).scroll(function(){
        if ($(window).scrollTop() > 1) {
            $('header').addClass('cont_header');
        }
        else {
            $('header').removeClass('cont_header');
        }
    });


What's wrong? How to fix?
Thank you for your attention Lord

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question