dmpost dmpost - 5 months ago 33x
Javascript Question

How CSS can disable window.onscroll?

The problem: Simple function doesn't called

window.onscroll = function() {

It will work if I remove the CSS link from the page

<link rel="stylesheet" href="/blog/css/style.css" type="text/css">

The question:
How CSS code can disable Javascript function window.onscroll ?

The page:

The CSS :


You are actually scrolling your container div. If you do this the events fire:

document.getElementById("container").onscroll = function() { 
    console.log("scroll container"); 

edit: looks like something changed on the page. If you use this on the above page it works correctly:

jQuery("body").on("scroll", function() {