Untitled
unknown
plain_text
a year ago
838 B
9
Indexable
(function () {
// Function to wait for an element to appear before proceeding
function waitForElement(selector, trigger, delayInterval, delayTimeout) {
var interval = setInterval(function () {
if (document && document.querySelector(selector)) {
clearInterval(interval);
trigger();
}
}, delayInterval);
setTimeout(function () {
clearInterval(interval);
}, delayTimeout);
}
function swapSections() {
const topSection = document.querySelector('.product__accordion_custom');
const ulElement = document.querySelector('.show-on-mob .show-desk:first-of-type');
if (topSection && ulElement) {
topSection.insertAdjacentElement('beforebegin', ulElement);
}
}
waitForElement('.product__accordion_custom', swapSections, 50, 15000);
})();
Editor is loading...
Leave a Comment