Skip to content
Snippets Groups Projects
Commit 6a65dce6 authored by Ekaterina Kondareva's avatar Ekaterina Kondareva
Browse files

hero content position

parent 33f7ea64
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,14 @@ export class HyHero {
if (!contentWrapper) return;
if (document.body.scrollWidth >= 1441) {
const marginLeft = parseInt(window.getComputedStyle(contentWrapper).getPropertyValue('margin-left')) + 32;
contentDiv.style.left = marginLeft !== 32 ? `${marginLeft}px` : '32px';
const marginLeft = parseInt(window.getComputedStyle(contentWrapper).getPropertyValue('margin-left'));
if (marginLeft > 32) {
contentDiv.style.left = `${marginLeft}px`;
} else if (marginLeft > 0) {
contentDiv.style.left = '32px';
} else if (marginLeft == 0) {
contentDiv.style.left = '0px';
}
} else {
contentDiv.style.left = window.getComputedStyle(contentWrapper).getPropertyValue('padding-left');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment