• monologish

    (@monologish)


    I am trying to customize the Mystile woocommerce theme for WordPress. Using bootstrap. In the mobile view on Chrome, as well as on my actual mobile device, when I open the site, Jquery is working incorrectly. The navbar-toggle button does nothing. I tried to get an alert to run when the button is clicked, still nothing. The moment I switch back to browser view, i.e. get out of the mobile view, the jquery is working fine. All my tests are running perfectly fine then.

    The JS file containing the test is being loaded in the mobile view as well. I can see it in the sources, with my code. It just does not execute.

    I am getting this error
    Uncaught TypeError: m.easing[this.easing] is not a function

    Code in the JS File

    jQuery(document).ready(function(){
    console.log('Inside general js');
    
    jQuery('#mobmenu').click(function(){
        console.log('Mobile menu clicked');
        alert('Mob Menu clicked');
    });
    
    jQuery(".feat-collection-holder").addClass('test');
    });

    I might be missing something painfully obvious, but I cannot wrap my head around why this would not work ONLY in the mobile view. This all there is to it. The file is getting loaded, it just won’t run in the mobile view.

    Also the first console.log message gets printed everytime, mobile or otherwise. Only the click function and addClass only work in the browser view and not the mobile view.

    Any help will be highly appreciated.

    EDIT: Things I have tried

    -Checked that Jquery is only called once.
    -Included Jquery UI
    -Included Jquery Easing plugin
    -Tried a newer version of Jquery

  • The topic ‘Jquery stops working in mobile view’ is closed to new replies.