Javascript not working with Cornerstone content?

Hi there!

I have this code

$(function() {
$(window).scroll(function() {
    console.log('scrolling ', $(window).scrollTop(), $(document).height());
    if($(window).scrollTop() >= 200 && $(window).scrollTop() <= ($(document).height() - 500)) {
        $('#landingpagefooter').removeClass('hide');
    } else {
        $('#landingpagefooter').addClass('hide');
    }
});

});

This could should hide / reveal a sticky footer upon scroll. However, it is giving a console error, so i think there is a problem using this with cornerstone?

Hi there @Tristanarkesteijn,

It’s your Javascript code itself, rather than Cornerstone. There are multiple syntax issues. I’d recommend running it through http://www.jslint.com/ and then fixing up any flagged issues. :slight_smile:

Thanks!