Fix home RWD

This commit is contained in:
Roman Pyrih
2024-11-26 12:08:11 +01:00
parent 43192a640e
commit cd8e9de7c0
6 changed files with 173 additions and 12 deletions

View File

@@ -49,3 +49,66 @@ $(function () {
$("#btn_continue_shopping").trigger("click")
})
})
$(function () {
$(window).on("load", function () {
let phoneBox = $("#_desktop_contact_link_temp").html();
$('#nav-phone-numb').html(phoneBox);
});
});
$(function () {
let originalParent = $("#st_banner_11").parent();
let originalPosition = $("#st_banner_11").index();
function moveBanner() {
let banner = $("#st_banner_11");
let targetSection = $("#content-wrapper #content .blog.blocks.displayHome");
if ($(window).width() <= 767) {
if (banner.parent().attr("id") !== "content") {
banner.detach().insertBefore(targetSection);
}
} else {
if (banner.parent().attr("id") !== originalParent.attr("id")) {
if (originalPosition === 0) {
originalParent.prepend(banner);
} else {
banner.detach().insertAfter(originalParent.children().eq(originalPosition - 1));
}
}
}
}
moveBanner();
$(window).on("resize", moveBanner);
});
$(function () {
let originalParentCustomText = $("#custom-text").parent();
let originalPositionCustomText = $("#custom-text").index();
function moveCustomText() {
let customText = $("#custom-text");
let banner = $("#st_banner_11");
if ($(window).width() <= 576) {
if (customText.next("#st_banner_11").length === 0) {
customText.detach().insertAfter(banner);
}
} else {
if (customText.parent().attr("id") !== originalParentCustomText.attr("id")) {
if (originalPositionCustomText === 0) {
originalParentCustomText.prepend(customText);
} else {
customText.detach().insertAfter(originalParentCustomText.children().eq(originalPositionCustomText - 1));
}
}
}
}
moveCustomText();
$(window).on("resize", moveCustomText);
});