I have a stickUp script that locks the menu on skrule and adds the isStuck class to this menu, which is responsible for position: fixed. I have a task: add a block with arbitrary content to the menu only when the isStuck class appears (when we scroll the page and the menu is fixed).
Tried to do so did not help:
$('.isStuck').html( "<p>Test</p>" ); So:
$('.isStuck').append( "<p>Test</p>" ); And even so, but here the content appears endlessly:
$(window).scroll(function() { if($(this).scrollTop() >= 190) { $('.isStuck').append( "<p>Test</p>" ); } else { $('.isStuck').remove( "<p>Test</p>" ); } });