mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
调整滑动吸顶
This commit is contained in:
@@ -263,8 +263,10 @@ export default {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleScroll(){
|
||||
let innerw = document.querySelector("#qa-fixd");
|
||||
let innerHeight = document.querySelector('#qa-list-content').clientHeight
|
||||
let outerHeight = document.documentElement.clientHeight
|
||||
let outerWidth = innerw.clientWidth;
|
||||
let scrollTop = document.documentElement.scrollTop
|
||||
if ((outerHeight + scrollTop + 350) >= innerHeight) {
|
||||
if(this.moreState == 1) {
|
||||
@@ -272,7 +274,7 @@ export default {
|
||||
}
|
||||
}
|
||||
if(scrollTop > 400) {
|
||||
document.querySelector('#qa-fixd').style.cssText = "position: fixed;top: 0px;width:410px;";
|
||||
document.querySelector('#qa-fixd').style.cssText = "position: fixed;top: 0px;width:"+outerWidth+"px";
|
||||
} else {
|
||||
document.querySelector('#qa-fixd').style.cssText = "position: static";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user