Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionAfter 4.9.9 update my custom JS code for a dropdown menu stopped working.
jQuery(document).ready(function( $ ) {
// menu mobile
$(function() {
$(".e-mobile-menu__main-menu .menu-item-has-children > a").click(function(e) {
e.preventDefault();
$(this)
.next("ul")
.toggleClass("js-mobile-menu-open");
$(".e-mobile-menu__main-menu .menu-item-has-children > a")
.not(this)
.next("ul")
.removeClass("js-mobile-menu-open");
$(".e-mobile-menu__main-menu .menu-item-has-children > a")
.not(this)
.removeClass("js-menu-active");
$(this).toggleClass("js-menu-active");
});
});
// menu desktop
$(function() {
$(".c-desktop-menu > div > ul > .menu-item-has-children > a").click(function(
e
) {
e.preventDefault();
$(this)
.next("ul")
.toggleClass("js-menu-open");
$(".c-desktop-menu > div > ul > .menu-item-has-children > a")
.not(this)
.next("ul")
.removeClass("js-menu-open");
$(".c-desktop-menu > div > ul > .menu-item-has-children > a")
.not(this)
.removeClass("js-menu-active");
$(this).toggleClass("js-menu-active");
});
});
});
This is my site: /. What's wrong?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionAfter 4.9.9 update my custom JS code for a dropdown menu stopped working.
jQuery(document).ready(function( $ ) {
// menu mobile
$(function() {
$(".e-mobile-menu__main-menu .menu-item-has-children > a").click(function(e) {
e.preventDefault();
$(this)
.next("ul")
.toggleClass("js-mobile-menu-open");
$(".e-mobile-menu__main-menu .menu-item-has-children > a")
.not(this)
.next("ul")
.removeClass("js-mobile-menu-open");
$(".e-mobile-menu__main-menu .menu-item-has-children > a")
.not(this)
.removeClass("js-menu-active");
$(this).toggleClass("js-menu-active");
});
});
// menu desktop
$(function() {
$(".c-desktop-menu > div > ul > .menu-item-has-children > a").click(function(
e
) {
e.preventDefault();
$(this)
.next("ul")
.toggleClass("js-menu-open");
$(".c-desktop-menu > div > ul > .menu-item-has-children > a")
.not(this)
.next("ul")
.removeClass("js-menu-open");
$(".c-desktop-menu > div > ul > .menu-item-has-children > a")
.not(this)
.removeClass("js-menu-active");
$(this).toggleClass("js-menu-active");
});
});
});
This is my site: https://www.manufakturamocy.pl/. What's wrong?
Share Improve this question edited Dec 19, 2018 at 14:26 RiddleMeThis 3,8078 gold badges22 silver badges30 bronze badges asked Dec 19, 2018 at 14:22 DamianDamian 971 gold badge1 silver badge11 bronze badges1 Answer
Reset to default 1you do have your menu JS code currently 2 times on the page.
- in https://www.manufakturamocy.pl/mm/wp-content/cache/minify/b6a70.default.include-body.8cc603.js
- and in https://www.manufakturamocy.pl/mm/wp-content/themes/mmocy/js/script.js?ver=4.9.9
which causes your menu open and close in the same time.
maybe a problem with your cache and JS minify plugin.