0.0.160 routes

This commit is contained in:
SBD
2025-02-17 16:53:45 +03:00
parent 8119955f52
commit e3fd8457c0
10 changed files with 140 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ $(document).ready(function() {
el: $(".b_filter_routes")[0],
recover_el_view: true,
ghost_block:{name: 'route_filters'},
$unnatach_bottom_el: $("footer")[0]
$unnatach_bottom_el: $(".b_dont_found_anth")[0]
})
_scroll.init()
$('body')[0].onscroll = function() {

View File

@@ -14,7 +14,8 @@ class scroll{
}
attachElementWhenScroll(){
if (!this.attached_by_bottom_el && this.$unnatach_bottom_el && this.$unnatach_bottom_el.getBoundingClientRect().top <= window.innerHeight && this.attached){
let bottom_el_in_screen = this.$unnatach_bottom_el.getBoundingClientRect().top <= window.innerHeight
if (!this.attached_by_bottom_el && this.$unnatach_bottom_el && bottom_el_in_screen && this.attached){
let $unnatach_bottom_el_margin_top= window.getComputedStyle(this.$unnatach_bottom_el)
$unnatach_bottom_el_margin_top = $unnatach_bottom_el_margin_top.getPropertyValue('margin-top');
$unnatach_bottom_el_margin_top = $unnatach_bottom_el_margin_top.split('p')
@@ -26,7 +27,7 @@ class scroll{
} else if (this.attached_by_bottom_el && this.$unnatach_bottom_el && this.$unnatach_bottom_el.getBoundingClientRect().top >= window.innerHeight) {
this.attachFunc(false)
}
if (!this.attached && this.$el.getBoundingClientRect().top <= this.attach_top) {
if (!this.attached && this.$el.getBoundingClientRect().top <= this.attach_top && !bottom_el_in_screen) {
this.attachFunc()
} else if ((this.$el.parentElement.getBoundingClientRect().top - this.attach_top) > 0){
this.$el.style.position = "unset";