I have a responsive drop down jquery menu. For some reason I removed a duplicated jquery library, because it was conflicting with WooCommerce and after that the drop-down responsive menu is not working.
Here is a link to my web site: https://www.santa-film.eu/
As you can see If you click on toggle icon, menu is not showing. here is the jQuery script used:
jQuery.fn.noSelect = function() {
var o = "none";
return this.bind("selectstart dragstart mousedown", function() {
return !1
}).css({
MozUserSelect: o,
msUserSelect: o,
webkitUserSelect: o,
userSelect: o
})
};
var ias = $.ias({
container: ".items",
item: ".item",
pagination: ".navigation",
next: ".nav-previous a"
});
ias.extension(new IASSpinnerExtension), $(document).ready(function() {
$(".dod").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".menus").hide(), $(this).attr("id", "0")) : ($(".menus").show(), $(this).attr("id", "1"))
}), $(".menus").mouseup(function() {
return !1
}), $(".dod").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".menus").hide(), $(".dod").attr("id", "")
})
}), $(document).ready(function() {
$(".rclic").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".rmenus").hide(), $(this).attr("id", "0")) : ($(".rmenus").show(), $(this).attr("id", "1"))
}), $(".rmenus").mouseup(function() {
return !1
}), $(".rclic").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".rmenus").hide(), $(".rclic").attr("id", "")
})
}), $(document).ready(function() {
$(".report").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".reportform").hide(), $(this).attr("id", "0")) : ($(".reportform").show(), $(this).attr("id", "1"))
}), $(".reportform").mouseup(function() {
return !1
}), $(".report").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".reportform").hide(), $(".report").attr("id", "")
})
}), $(document).ready(function() {
$(".buscaboton").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".buscaformulario").hide(), $(this).attr("id", "0")) : ($(".buscaformulario").show(), $(this).attr("id", "1"))
}), $(".buscaformulario").mouseup(function() {
return !1
}), $(".buscaboton").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".buscaformulario").hide(), $(".buscaboton").attr("id", "")
})
}), $(document).ready(function() {
$(".rclic2").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".rbuscar").hide(), $(this).attr("id", "0")) : ($(".rbuscar").show(), $(this).attr("id", "1"))
}), $(".rbuscar").mouseup(function() {
return !1
}), $(".rclic2").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".rbuscar").hide(), $(".rclic2").attr("id", "")
})
});
So is there a way to get that drop down work correctly?
Thanks
I search a lot in Internet and I found a solution for conflicting Jquery in wordpress and theme.
So I removed Jquery tag from my header and I used This code to avoid any conflict between my javascript and jquery:
jQuery.noConflict(); (function( $ ) { // Paste your Code Here... })( jQuery );
like This:
jQuery.noConflict();
(function( $ ) {
$(document).ready(function() {
$(".rclic").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".rmenus").hide(), $(this).attr("id", "0")) : ($(".rmenus").show(), $(this).attr("id", "1"))
}), $(".rmenus").mouseup(function() {
return !1
}), $(".rclic").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".rmenus").hide(), $(".rclic").attr("id", "")
})
}), $(document).ready(function() {
$(".report").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".reportform").hide(), $(this).attr("id", "0")) : ($(".reportform").show(), $(this).attr("id", "1"))
}), $(".reportform").mouseup(function() {
return !1
}), $(".report").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".reportform").hide(), $(".report").attr("id", "")
})
}), $(document).ready(function() {
$(".buscaboton").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".buscaformulario").hide(), $(this).attr("id", "0")) : ($(".buscaformulario").show(), $(this).attr("id", "1"))
}), $(".buscaformulario").mouseup(function() {
return !1
}), $(".buscaboton").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".buscaformulario").hide(), $(".buscaboton").attr("id", "")
})
}), $(document).ready(function() {
$(".rclic2").click(function() {
var o = $(this).attr("id");
1 == o ? ($(".rbuscar").hide(), $(this).attr("id", "0")) : ($(".rbuscar").show(), $(this).attr("id", "1"))
}), $(".rbuscar").mouseup(function() {
return !1
}), $(".rclic2").mouseup(function() {
return !1
}), $(document).mouseup(function() {
$(".rbuscar").hide(), $(".rclic2").attr("id", "")
})
});
})( jQuery );
I share this solution to help other people may have this problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.