My custom code conflicts with some other JavaScript file in my WordPress website.
Code which ocurs conflict is here. When I remove google APIs for jQuery everything works fine except this code then it stops working. I have tried to modify code with noconflict but it did not help. Maybe I did it wrong.
When script is there it makes address delivery checker stop working.
<script>$.noConflict();</script><script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="pondelok" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="utorok" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="streda" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="stvrtok" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="piatok" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="sobota" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 21:00.</h4>
</div>
<div id="nedela" class="msg">
<h4>Objednávky dnes prijímame od 11:00 do 20:00.</h4>
</div>
<script>
var Now = new Date();
var CurrentDay = Now.getDay();
var CurrentHrs = Now.getHours();
if (CurrentDay == 1 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#pondelok').show();
}else if (CurrentDay == 2 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#utorok').show();
} else if (CurrentDay == 3 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#streda').show();
} else if (CurrentDay == 4 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#stvrtok').show();
} else if (CurrentDay == 5 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#piatok').show();
} else if (CurrentDay == 6 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#sobota').show();
} else if (CurrentDay == 0 && (CurrentHrs >= 00 && CurrentHrs <= 24)) {
$('.msg').hide()
$('#nedela').show();
} else{
$('.msg').hide()
$('#no_del').show();
}
var weekday = new Date();
weekday[0]= "Nedeľa";
weekday[1] = "Pondelok";
weekday[2] = "Utorok";
weekday[3] = "Streda";
weekday[4] = "Štvrtok";
weekday[5] = "Piatok";
weekday[6] = "Sobota";
var n = weekday[tomorrow.getDay()];
document.getElementById("nextDay").innerHTML = n;
var jq211= jQuery.noConflict();
</script>
Thank you for your help.
.noConflict(), it clears jQuery such that you can no longer use$.