I’m using a feature for when the user scrolls my navigation bar changes CSS. It works fine until I install woocommerce plugin using the canvas theme.

This is my code JavaScript code which is currently fired after the nav div tag (using a hook) but I have tried it in a few places.

<script type="text/javascript">
   $(document).on("scroll",function(){
        if($(document).scrollTop()>100){
            $(window).off("scroll");
            $("nav").removeClass("large").addClass("small");
            $("#nav-container").removeClass("navlarge").addClass("navsmall");
        } else{
            $(window).off("scroll");
            $("nav").removeClass("small").addClass("large");
            $("#nav-container").removeClass("navsmall").addClass("navlarge");
        }
    });
</script>

Any ideas why it would conflict with woocommerce?

Read more here: Woocommerce & on scroll javascript conflict


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: