Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Responsive menu toggle for mobile not working on some pages

Discussion in 'Misc WordPress Requests' started by ckbrewer15, Nov 1, 2017.

  1. ckbrewer15

    Guest

    Reply To: Responsive menu toggle for mobile not working on some pages, by ckbrewer15

    To create the functionality to open/close a menu, you can use JavaScript. I see jQuery is installed on your website. I did not come across any code in place to do this for you.

    If you have no experience with JavaScript files, please install a plugin such as this one that will allow you to add custom CSS and JavaScript easily:

    https://en-ca.wordpress.org/plugins/custom-css-js/

    Create a new JS file and for the options select to load in the footer and on the front end. Add this JavaScript:

    $(document).ready(function() {
    $(‘#navigation’).click(function() {
    $(‘#menu-main-menu’).toggle();
    });
    });

    Basically what this tells the browser to do is to wait for the page to load and when ready, listen to the navigation button for any clicks. If a click happens, toggle the menu items on or off.

    I see that the website is using a very old version of jQuery, the code I provided may not work properly. You are using version 1.12.4 whereas the current version is 3.2.1 as of today. If you require further assistance with any of this, I would recommend contacting a professional web developer such as myself, we are easy to find.

    You may also need to style the mobile menu after it opens. It’s possible the previous owner did not do so. When I tested it, I did not see any mobile-friendly styles for menu items.

    Good luck.

    Reply To: Responsive menu toggle for mobile not working on some pages
     
    #1

Share This Page

Web Hosting