https://www.one65sf.com/index2_upwork.html
Сейчас. Прочтите мой текст ниже, чтобы помочь мне лучше.
Требования клиента.
Логотипы должны открывать модальное окно, похожее на «Заказать сейчас». модальное окно, и вся информация для каждого местоположения логотипа, находящегося в данный момент в рамке, должна находиться внутри модального окна.
вот мой рабочий код>.
Код: Выделить всё
// JavaScript code to hide overflow
document.getElementById('floor-3').style.overflow = 'hidden';
/*
Layout adjustments
*/
var buildingPieces,
textBlock,
buildinPiecesTopDistance,
mobileStylesStartBelowWidth = 768;
function adjustTextContentHeight() {
var buildingHeight = buildingPieces.clientHeight;
textBlock.style.height = buildingHeight + "px";
}
/*
Mobiles(small screens)
- Text block should start at the same position(vertial) as the One65 building
*/
function mobilesAboutFloorsTopDistance() {
if (window.innerWidth < mobileStylesStartBelowWidth) {
var contentWidth = textBlock.parentElement.clientWidth,
widthForText = contentWidth - buildingPieces.clientWidth,
buildingMarginLeft = ~parseInt(getComputedStyle(textBlock.previousElementSibling).marginLeft);
textBlock.style.width = widthForText + buildingMarginLeft + "px";
} else {
textBlock.style.marginTop = "auto";
textBlock.style.height = "";
textBlock.style.width = "";
}
}
var buildingNormImgLoaded = 0,
buildingNormalFloorImgs;
function normFloorImgLoaded() {
buildingNormImgLoaded++;
if (!buildingNormalFloorImgs) {
buildingNormalFloorImgs = document.querySelectorAll("#one65building .ctn.norm img");
}
// ensure that one type of floor images have loaded so that the top distance is only calculated afterwards
if (buildingNormImgLoaded === buildingNormalFloorImgs.length) {
buildingPieces = document.querySelector("#one65building .building-pieces");
buildinPiecesTopDistance = buildingPieces.getBoundingClientRect().top;
textBlock = document.querySelector("#text-block");
adjustTextContentHeight();
setTimeout(mobilesAboutFloorsTopDistance,);
window.addEventListener("resize", mobilesAboutFloorsTopDistance);
window.addEventListener("load", adjustTextContentHeight);
window.addEventListener("resize", adjustTextContentHeight);
}
}
[img]img/about-floors/o.png[/img]
[img]img/about-floors/elementsbar.png[/img]
[img]img/about-floors/bistro2.png[/img]
[img]img/about-floors/patisserie.png[/img]
function go(){
alert("button is working");
}
если вы нажмете «Заказать сейчас» Кнопка на главной странице, появляется всплывающее модальное окно. Я хочу то же самое, когда кто-то нажимает на логотипы с правой стороны здания.
и почему? На некоторых телефонах, например, Iphone XR и некоторых других, логотипы на правой стороне мешают, на остальных все в порядке.
Я не понимаю, почему?
Буду признателен за любую помощь. спасибо,
Я пробовал каждый клик, и функции Js ничего не дают, у меня все работает.
Я хочу открывать модальное окно, когда кто-то нажимает на правую часть создания логотипа.
Я хочу открыть модальное окно, когда кто-то нажимает на правую часть создания логотипа.
п>
Подробнее здесь: https://stackoverflow.com/questions/790 ... ct-section
Мобильная версия