scroll doc page

This commit is contained in:
SBD
2024-07-12 19:32:49 +03:00
parent b5086cbd40
commit c9d591fa40
3 changed files with 28 additions and 12 deletions

View File

@@ -1738,11 +1738,12 @@ body.n_scroll{
.left_curtain_documentation{
width: 373px;
height: fit-content;
}
.tree_documentation_container{
width: 100%;
height: calc(100vh - 295px);
overflow-y: auto;
}
.tree_documentation_container.hide_scroll::-webkit-scrollbar{
@@ -1878,6 +1879,7 @@ body.n_scroll{
.flex_container_tree_and_content{
display: flex;
width: 100%;
position: relative;
}
.content_part_tree_els{

View File

@@ -9,6 +9,7 @@
@media (max-width: 1024px) {
.left_curtain_documentation{
width: 320px;
height: 100vh;
}
.tree_documentation_container_first_level_txt{
margin-bottom: 0;
@@ -49,6 +50,7 @@
height: 100vh;
overflow-y: auto;
padding: 0 15px;
}
.content_part_tree_els{
width: 100%;

View File

@@ -584,6 +584,7 @@ function showContentPartTree (el) {
}
}
let waitingTop = null
let maxScroll = null
$(window).scroll(function (){
if (getInfoAboutUser()[0] !== 'laptop' && getInfoAboutUser()[0] !== 'mobile'){
if (window.location.href.includes("docs")){
@@ -591,20 +592,31 @@ $(window).scroll(function (){
let scroll = $(window)[0].scrollY
if (scroll === 0){
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
maxScroll = $(".documentation_block")[0].getBoundingClientRect().bottom - $(".left_curtain_documentation")[0].offsetHeight - 172
}
let $new_curtain = $($curtain[1])
if (scroll < maxScroll || !maxScroll){
if (!$curtain[1] && waitingTop){
$new_curtain = $curtain.clone()
$new_curtain.insertAfter($curtain)
}
if (scroll >= waitingTop && waitingTop){
$new_curtain.css({position:'fixed',top: 166})
$new_curtain.css({position:'fixed',top: 166,bottom:"unset"})
$($curtain[0]).css({opacity:0})
} else if (scroll < waitingTop && waitingTop) {
$new_curtain.remove()
$($curtain[0]).css({opacity:1})
} else if (!waitingTop){
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
maxScroll = $(".documentation_block")[0].getBoundingClientRect().bottom - $(".left_curtain_documentation")[0].offsetHeight - 172
}
} else {
if (!$curtain[1]){
$new_curtain = $curtain.clone()
$new_curtain.insertAfter($curtain)
}
$new_curtain.css({position:'absolute',bottom: 0,top: 'unset'})
$($curtain[0]).css({opacity:0})
}
}
}