I have a problem with this small code:
<script type='text/javascript'>
var mn = $(".stickyad");
$(window).scroll(function () {
if( $(this).scrollTop() > 250 ) {
mn.addClass("stickyad-fixed");
} else {
mn.removeClass("stickyad-fixed");
}
});
</script>
the Bar is sticky at the level of 250. but I want to disable this option when it gets the bottom of the page or 600. just like in this blog: https://cleanblog-codiblog.blogspot.com/
I found this code:
$(document).ready(function() {
$(window).scroll(function () {
console.log($(window).scrollTop());
if ($(window).scrollTop() > 250) {
$('#stickyad').addClass('stickyad-fixed');
}
if ($(window).scrollTop() > 600) {
$('#stickyad').removeClass('stickyad-fixed');
}
});
});
But the problem is when I go back to top the Bar stays fixed
Thank you very much