Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1130349
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.
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: /. 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.
本文标签: javascriptCustom JS doesn39t work after 499 update
版权声明:本文标题:javascript - Custom JS doesn't work after 4.9.9 update 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749084369a2313541.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论