// Save the original console.warn function const originalConsoleWarn = console.warn; // Override console.warn to suppress the warning console.warn = function (message) { if (message && message.includes('Found 24 elements with non-unique id')) { return; // Ignore the warning message about non-unique IDs } originalConsoleWarn.apply(console, arguments); // Call the original console.warn for other warnings }; /* console.warn = function () {}; window.onerror = function (message, source, lineno, colno, error) { return true; }; window.onunhandledrejection = function (event) { event.preventDefault(); }; */ function openLightbox() { document.getElementById('lightboxBackground').style.display = 'flex'; } function closeLightbox() { document.getElementById('lightboxBackground').style.display = 'none'; } function showTab(tabId) { // Hide all tab contents document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active')); // Remove active class from all tabs document.querySelectorAll('.tab').forEach(tab => tab.classList.remove('active')); // Show the selected tab content and make the corresponding tab active document.getElementById(tabId).classList.add('active'); document.querySelector(`.tab[onclick="showTab('${tabId}')"]`).classList.add('active'); } // Close the lightbox when clicking outside of the modal document.getElementById('lightboxBackground').addEventListener('click', function(event) { if (event.target === this) { closeLightbox(); } }); // You can also use "$(window).load(function() {" $(function () { // Slideshow 4 $("#slider4").responsiveSlides({ auto: true, pager: true, nav: true, speed: 500, namespace: "callbacks", before: function () { $('.events').append("
  • before event fired.
  • "); }, after: function () { $('.events').append("
  • after event fired.
  • "); } }); }); jQuery(document).ready(function() { var offset = 220; var duration = 500; jQuery(window).scroll(function() { if (jQuery(this).scrollTop() > offset) { jQuery('.back-to-top').fadeIn(duration); } else { jQuery('.back-to-top').fadeOut(duration); } }); jQuery('.back-to-top').click(function(event) { event.preventDefault(); jQuery('html, body').animate({scrollTop: 0}, duration); return false; }) }); $(document).ready(function() { var s = $("#sticker"); var pos = s.position(); $(window).scroll(function() { var windowpos = $(window).scrollTop(); if (windowpos >= pos.top) { s.addClass("stick"); } else { s.removeClass("stick"); } }); }); $(document).ready(function() { $('#nav').slicknav({ allowParentLinks: "true" }); $(document).on('click', '.slicknav_btn', function(e) { e.preventDefault(); // Prevent default link action if needed $('.slicknav_menu').css('position', function(index, currentPosition) { return currentPosition === 'absolute' ? 'relative' : 'absolute'; }); $('#logo').css('position', function(index, currentPosition) { return currentPosition === 'absolute' ? 'relative' : 'absolute'; }); }); }); $(window).load(function(){ $(".ddd").on("click", function () { var $button = $(this); var oldValue = $button.closest('.sp-quantity').find("input.quntity-input").val(); // Don't allow decrementing below zero if (oldValue > 1) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 1; } $button.closest('.sp-quantity').find("input.quntity-input").val(newVal); }); $(".dddd").on("click", function () { var $button = $(this); var oldValue = $button.closest('.sp-quantity').find("input.quntity-input").val(); var newVal = parseFloat(oldValue) + 1; $button.closest('.sp-quantity').find("input.quntity-input").val(newVal); }); }); $(document).ready(function(){ $(".close").click(function(){ $.ajax({ type: 'POST', url: 'script.php', success: function(data) { $('#listainfo').css('display','none'); } }); }); }); $(document).ready(function(){ $(".closecookies").click(function(){ $.ajax({ type: 'POST', url: 'script2.php', success: function(data) { $('#cookies').css('display','none'); } }); }); }); $(document).ready(function(){ $("#cookiesuhlas3").click(function(){ $.ajax({ type: 'POST', url: 'script2.php', success: function(data) { $('#lightboxBackground').css('display','none'); document.getElementById("technickeCheckbox").checked = true; document.getElementById("vykonnostCheckbox").checked = true; document.getElementById("personalizaciaCheckbox").checked = true; } }); }); }); $(window).load(function(){ $("#cookies").hide(); function ahref(){ $("#cookies").show(); }; window.setTimeout( ahref, 700 ); // 2 seconds }) function showSlidingDiv1x(){ $(".slidingDiv1x").animate({"height": "toggle"}, { duration: 250 }); } function showSlidingDiv2x(){ $(".slidingDiv2x").animate({"height": "toggle"}, { duration: 250 }); } function showSlidingDiv3x(){ $(".slidingDiv3x").animate({"height": "toggle"}, { duration: 250 }); } function showSlidingDiv4x(){ $(".slidingDiv4x").animate({"height": "toggle"}, { duration: 250 }); } function showSlidingDiv5x(){ $(".slidingDiv5x").animate({"height": "toggle"}, { duration: 250 }); } function showSlidingDiv6x(){ $(".slidingDiv6x").animate({"height": "toggle"}, { duration: 250 }); } /* function showSlidingparameter1(){ $(".parameter1").animate({"height": "toggle"}, { duration: 250 }); } */ function showSlidingparameter1() { $(".parameter1").animate( {"height": "toggle"}, { duration: 250, step: function (now, fx) { if (fx.prop === "height") { $(this).css("display", "inline-block"); } }, complete: function () { const button = $(".loadmoreitems"); if ($(".parameter1").is(":visible")) { button.html('Načítať menej '); } else { button.html('Načítať ďalšie '); } } } ); } function showSlidingmorevalues() { $(".morevalues").animate( {"height": "toggle"}, { duration: 250, step: function (now, fx) { if (fx.prop === "height") { $(this).css("display", "inline-block"); } }, complete: function () { const button = $("#morevaluesbutton"); const button2 = $("#morevaluesbutton2"); if ($(".morevalues").is(":visible")) { button.html('Načítať menej '); button2.html('Načítať menej '); } else { button.html('Načítať viac '); button2.html('Načítať viac '); } } } ); } $(document).ready(function(){ $("#vyber1").change(function(){ var cid=$(this).val(); $("#vyber3 option:not(:first)").remove(); $("#vyber4 option:not(:first)").remove(); $("#vyber5 option:not(:first)").remove(); $("#vyber6 option:not(:first)").remove(); $.ajax({ url:'moduly/ajax/load_products.php', type:'post', data:{id:cid}, success:function(res){ $("#vyber2").html(res); } }); }); }); $(document).ready(function(){ $("#vyber2").change(function(){ var cid=$("#vyber1").val(); var cid2=$(this).val(); $("#vyber4 option:not(:first)").remove(); $("#vyber5 option:not(:first)").remove(); $("#vyber6 option:not(:first)").remove(); $.ajax({ url:'moduly/ajax/load_products2.php', type:'post', data:{id:cid2, id2:cid}, success:function(res){ $("#vyber3").html(res); } }); }); }); $(document).ready(function(){ $("#vyber3").change(function(){ var cid=$("#vyber1").val(); var cid2=$("#vyber2").val(); var cid3=$("#vyber3").val(); var cid4=$(this).val(); $("#vyber5 option:not(:first)").remove(); $("#vyber6 option:not(:first)").remove(); $.ajax({ url:'moduly/ajax/load_products3.php', type:'post', data:{id:cid, id2:cid2, id3:cid3, id4:cid4}, success:function(res){ $("#vyber4").html(res); } }); }); }); $(document).ready(function(){ $("#vyber4").change(function(){ var cid=$("#vyber1").val(); var cid2=$("#vyber2").val(); var cid3=$("#vyber3").val(); var cid4=$("#vyber4").val(); var cid5=$(this).val(); $("#vyber6 option:not(:first)").remove(); $.ajax({ url:'moduly/ajax/load_products4.php', type:'post', data:{id:cid, id2:cid2, id3:cid3, id4:cid4, id5:cid5}, success:function(res){ $("#vyber5").html(res); } }); }); }); $(document).ready(function(){ $("#vyber5").change(function(){ var cid=$("#vyber1").val(); var cid2=$("#vyber2").val(); var cid3=$("#vyber3").val(); var cid4=$("#vyber4").val(); var cid5=$("#vyber5").val(); var cid6=$(this).val(); $.ajax({ url:'moduly/ajax/load_products5.php', type:'post', data:{id:cid, id2:cid2, id3:cid3, id4:cid4, id5:cid5, id6:cid6}, success:function(res){ $("#vyber6").html(res); } }); }); }); $(document).ready(function(){ $("#keyword").keyup(function(){ $.ajax({ type: "POST", url: "autocomplete/autocomplete.php", data: 'keyword=' + $(this).val(), beforeSend: function(){ $("#keyword").css("background", "#FFF url(autocomplete/LoaderIcon.gif) no-repeat 165px"); }, success: function(data){ $("#suggesstion-box").show(); $("#suggesstion-box").html(data); $("#keyword").css("background", "#FFF"); } }); }); // Hide suggestion box when clicking outside $(document).click(function(e) { if (!$(e.target).closest('#suggesstion-box, #keyword').length) { $("#suggesstion-box").hide(); } }); // Prevent hiding suggestion box when clicking inside it $("#suggesstion-box").click(function(e) { e.stopPropagation(); }); // Show suggestion box when clicking on the keyword input again $("#keyword").click(function() { if ($("#suggesstion-box").html().trim() != "") { $("#suggesstion-box").show(); } }); }); function selectkeyword(val) { $("#keyword").val(val); $("#suggesstion-box").hide(); } $(document).ready(function(){ $("#keyword2").keyup(function(){ $.ajax({ type: "POST", url: "autocomplete/autocomplete2.php", data:'keyword='+$(this).val(), beforeSend: function(){ $("#keyword2").css("background","#FFF url(autocomplete/LoaderIcon.gif) no-repeat 165px"); }, success: function(data){ $("#suggesstion-box2").show(); $("#suggesstion-box2").html(data); $("#keyword2").css("background","#FFF"); } }); }); }); function selectkeyword(val) { $("#keyword2").val(val); $("#suggesstion-box2").hide(); } function remover() { var id = $(".vymazat").val(); $.ajax({ type: "GET", url: "moduly/ajax/ajaxkosikedit.php", data: "id="+ id, success: function(data) { /*alert(id);*/ /*container = $('#content'); kosikbox = $('#kosikbox'); container.load('moduly/ajax/kosik-after-delete-ajax.php?fullurl='); kosikbox.load('moduly/ajax/kosikbox.php?fullurl='); $('.vymazat').remove();*/ } }); } function closebasketwindow(){ $('#content').toggleClass("ajaxchange2"); } function closebasketwindow2(){ $('#ajaxbox').html(""); } $("#kosik_tlacidlo").hover(function () { $('#content').addClass('ajaxchange2'); }); $("#content").mouseleave(function(){ setTimeout(function(){ $('#content').removeClass('ajaxchange2'); }, 20000) }); kosikbox_mobil = $('#kosikbox_mobil'); kosikbox_mobil.load('moduly/ajax/kosikbox.php?fullurl=');