ClassicPress / ClassicPress-Themes

The ClassicPress.net themes
3 stars 3 forks source link

Updating JS file #8

Closed KTS915 closed 6 years ago

KTS915 commented 6 years ago

The file at js/scripts.js file should be updated to look like this:

jQuery(document).ready(function($) {
    'use strict'; // satisfy code inspectors

    if (window.matchMedia("screen and (max-width: 800px)").matches) {
        $('#menu-toggle').click(function() {
            $('.main-navigation').toggle();
            $('.get-started').toggle();
            $(this).attr('aria-expanded', function(_, attr) {
                return !(attr == 'true');
            });
        });
    }
    if (window.matchMedia("screen and (min-width: 801px)").matches) {
        $('.menu li a').on('mouseenter focus', function() {
            $(this).next('.sub-menu').show();
            $(this).parent().siblings().children('.sub-menu').hide();
        });
        $('.logo, .get-started').on('mouseenter focus', function() {
            $(this).siblings('nav').find('.sub-menu').hide();
        });
    }
});
striebwj commented 6 years ago

@KTS915 pushing that change now.

KTS915 commented 6 years ago

Thanks very much, @striebwj ! Not too much left now, I think!