1

We have been looking for a while now but still haven't found the solution to this matter.

We are designing the site in wordpress

URL: http://jouwdesign.be/fontanella/site/lunchmenu/

The golden menu (.submenu) has a script linked to it wich should add the class 'test' when scrolling vertically past 100 pixels. For some reason it wouldn't even display a classchange when inspecting in chrome or any other browser. We already tried to disable all custom js and plugins but no luck so far.

Here is the jQuery:

jQuery(document).ready(function($) {
    $(window).scroll(function() {    
        var scroll = $(window).scrollTop();

        if ($(window).scrollTop() >= 100) {
            $(".submenu").addClass("test");
        }
    });
});

Anyone who has experienced the same problem in wordpress or any other ways?

Thanks!

  • Where are you embeding your custom javascript? First check if script is being run at all. In inspect element i see that u placed it like: but is that workign at all. If u add console.log("blabl"); to it, does it shows in console? – Goran Jakovljevic Nov 25 '15 at 23:51
  • Possible duplicate of [jQuery scrollTop() returns 0 for all elements](http://stackoverflow.com/questions/22173454/jquery-scrolltop-returns-0-for-all-elements) – rnevius Nov 26 '15 at 01:13
  • You can see here (in inspector) the script (script.js) is loaded and running on the page: http://i.cubeupload.com/PQ7Ori.jpg The script 'cornerstone-custom-js' is a phantom / leftover from earlier tries but hasn't got anything to do with the conflict because the phantom is only on this page. On a page like here (jouwdesign.be/fontanella/site/suggesties/) we can see there is no panthom but the script.js has no reaction whatsoever either. – Thomas Timmers Nov 26 '15 at 08:35

1 Answers1

2

Found the solution. I had to remove 'height 100%' on my body tag in css All works fine now!