Разрабатываю сайт и настал момент сделать его красивым и в мобильной версии. Добавил повторно меню и скрыл его, при мобильном разрешении появляется "бургер" по нажатию на который меню и раскрывается. Теперь поднялся вопрос. Если раскрывать меню с любой страницы кроме главной (именно с телефона, а не с инструментов разработчика) то всё хорошо работает, однако если попытаться раскрыть меню на главной странице, то просто никак не реагирует.
<div class="top-menu-phone">
<?$APPLICATION->IncludeComponent(
"bitrix:menu",
"store_v3_swipe1",
[
"ROOT_MENU_TYPE" => "top",
"MAX_LEVEL" => "1",
"CHILD_MENU_TYPE" => "left",
"USE_EXT" => "Y",
"MENU_CACHE_TYPE" => "A",
"MENU_CACHE_TIME" => "36000000",
"MENU_CACHE_USE_GROUPS" => "Y",
"MENU_CACHE_GET_VARS" => [
],
"COMPONENT_TEMPLATE" => "store_v3_swipe1",
"DELAY" => "Y",
"ALLOW_MULTI_SELECT" => "N"
],
false,
[
"ACTIVE_COMPONENT" => "Y"
]
);?>
</div>
.top-menu-phone
{
display: none;
text-align: right;
position: relative;
width: 30%;
margin: auto 0;
}
@media only screen and (max-device-width: 769px) {
.top-menu-phone {display: block;}
}
css компонента:
.menu-main {
display: block;
padding-left: 16px;
padding-top: 5px;
margin: 5px 0 35px;
width: 100%;
list-style: none;
}
.menu-swipe-btn {
width: 46px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
}
.menu-swipe-overlay {
position: absolute;
top: 90px;
right: 0;
bottom: 0;
left: 0;
min-height: 440px;
width: 882px;
pointer-events: none;
z-index: 190;
background: rgba(0, 0, 0, 0.5);
transition: opacity 170ms ease;
opacity: 0;
}
.menu-swipe-container.opened .menu-swipe-overlay {
opacity: 1;
pointer-events: auto;
}
.menu-swipe-container.opened {}
.menu-swipe-items-container {
position: absolute;
top: 90px;
right: 0;
bottom: 0;
min-height: 440px;
box-sizing: border-box;
z-index: 195;
width: 0;
transition: height 170ms ease;
max-width: 882px;
}
.menu-swipe-container.opened .menu-swipe-items-container {
width: 100%;
}
.menu-swipe-items-scroll-block {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
min-height: 440px;
box-sizing: border-box;
overflow-y: auto;
background-color: #f3f3f3;
}
.menu-swipe-items {
display: block;
padding: 0;
margin: 0;
}
.menu-swipe-item {
display: block;
margin: 0;
}
.menu-swipe-item-link {
padding: 0 17px 0 0;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
min-height: 40px;
text-decoration: none !important;
vertical-align: middle;
}
.menu-swipe-item-text {
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 21px;
color: #121212;
opacity: 0.6;
padding-left: 10px;
}
.menu-swipe-item:active,
.menu-swipe-item:hover,
.menu-swipe-item.selected .menu-swipe-item-text { opacity: 1; }
.menu-swipe-item-angle {
display: none;
transform: rotate(-45deg);
border-bottom: 1px solid;
border-right: 1px solid;
color: #121212;
opacity: 0.6;
width: 7px;
height: 7px;
}
.menu-swipe-close-btn {
position: absolute;
right: calc(0 - 19px - 38px);
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.4);
box-sizing: border-box;
border-radius: 50%;
top:15px;
width: 38px;
height: 38px;
align-items: center;
justify-content: center;
transition: right 170ms ease;
opacity: 0;
display: none;
}
.menu-swipe-container.opened {
right: calc(100% + 19px);
opacity: 1;
display: flex;
}
Также если потребуется скину код самого компонента, но я просто понять не могу, почему не открывается конкретно на главной странице это меню? На остальных страницах такой проблемы нет.