Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar position issue #184

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Sidebar position issue #184

merged 2 commits into from
Aug 31, 2023

Conversation

unki11
Copy link
Contributor

@unki11 unki11 commented Aug 31, 2023

#129 To-Sidebar 개선 cause of the problem

If the height is less than 800px when accessing the site, 'affix class' (postion: fixed) is assigned to the sidebar.

var h = $(window).height();
//console.log (h);
if (h > 800) {
$( "#mysidebar" ).attr("class", "nav affix");
}

If the width is less than 990px, the 'position: relative' property is assigned to the sidebar.

@media (max-width: 990px) {
#mysidebar {
position: relative;
}
}
@media (min-width: 1000px) {
div#mysidebar {
width: 100%;
max-width: 14%;
}
}
@media (max-width: 900px) {
div#mysidebar {
max-width: 100%;
}
}

Lines 1036 to 1053 in ed54ddb

If 'afiix Class' is not assigned (height > 800) and the width is over 990px, postion is not specified. See the screen below

image

Therefore, it was modified so that the affix class is assigned in all conditions.

Compare
Before
After


#129 To-Sidebar 개선 문제 원인

사이트 접속시 height가 800이하일 경우 sidebar에 'affix' class가(postion : fixed) 부여됨.

var h = $(window).height();
//console.log (h);
if (h > 800) {
$( "#mysidebar" ).attr("class", "nav affix");
}

width가 990px 이하일 경우 sidebar에 position : relative 속성이 부여됨.

@media (max-width: 990px) {
#mysidebar {
position: relative;
}
}
@media (min-width: 1000px) {
div#mysidebar {
width: 100%;
max-width: 14%;
}
}
@media (max-width: 900px) {
div#mysidebar {
max-width: 100%;
}
}

afiix Class가 부여되지 않고(height > 800) width가 990px 이상일 경우 postion이 따로 지정되지 않아 아래와 같이 보임.

image

따라서 모든 조건에서 affix class이 할당되도록 수정하였습니다.

비교해보세요.
변경전
변경후

@dokabi
Copy link
Collaborator

dokabi commented Aug 31, 2023

Thank you! For the width issues, you can work with another PR.

@dokabi dokabi merged commit 9fcd573 into Azure:main Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants