// Javascript general para todas las tiendas nubixstore // Autor: Martin Carrillo // Version 0.3 // Ăšltima modificacion: 19-06-2025 function NS_preventBack() { window.history.forward(); } function NS_triggerClick(id) { const el = document.getElementById(id); if (el) { el.scrollIntoView({ behavior: 'smooth', block: 'center' }); // Hace scroll suave setTimeout(() => el.click(), 500); // Espera medio segundo y hace clic } } (function ($) { // Get the header var header = document.getElementById("header"); var isCheckout = $( ".is-checkout")[0]; if (header && !isCheckout) { // When the user scrolls the page, execute myFunction window.onscroll = function() { myFunction(); }; // Get the offset position of the navbar var sticky = header.offsetTop + 100; // Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position function myFunction() { if (window.pageYOffset >= sticky) { header.classList.add("sticky"); } else { header.classList.remove("sticky"); } } } if (header && isCheckout) { $('#header').removeClass('navbar-sticky'); } $('#checkout-form').submit(function(){ $('input[type=submit]', this).attr('disabled', 'disabled'); $('#sending').fadeIn(); }); }(jQuery));