P
P
Pavel Zinoviev2014-07-24 16:17:57
JavaScript
Pavel Zinoviev, 2014-07-24 16:17:57

How to make the code work?

Code runs without error, scroll event is handled but no classes are added
javascript:
pastie.org/private/dqoktl6r3pbhb0w7hep5a
coffeescript:
pastie.org/private/w5fiqoaeeuzayiozhnc1lq

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Voronkov, 2014-07-24
@zombiQWERTY

Most likely, the script is connected in the head and there the body does not exist yet, but try to do the initialization on the full page load event like this

$(function(){
    disableHover = new DisableHover($("body"));

    disableHover.scroll();
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question