0.0.160 routes
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user