fix top and articel list
This commit is contained in:
parent
76de2e555f
commit
1449524d4e
@ -1327,7 +1327,7 @@ modal
|
|||||||
background-color #000
|
background-color #000
|
||||||
padding 10px
|
padding 10px
|
||||||
box-shadow 0 0 8px #000
|
box-shadow 0 0 8px #000
|
||||||
z-index 999
|
z-index 99999
|
||||||
padding-bottom 20px
|
padding-bottom 20px
|
||||||
min-width 240px
|
min-width 240px
|
||||||
max-width 300px
|
max-width 300px
|
||||||
|
@ -2,11 +2,11 @@ import '~/layouts/common.styl'
|
|||||||
import vditor from 'vditor'
|
import vditor from 'vditor'
|
||||||
import 'vditor/dist/index.css'
|
import 'vditor/dist/index.css'
|
||||||
|
|
||||||
// const $tags = document.getElementById('tags')
|
const $tags = document.getElementById('tags')
|
||||||
// let floatTop = null
|
let floatTop = null
|
||||||
// if ($tags) {
|
if ($tags) {
|
||||||
// floatTop = $tags.offsetTop + $tags.scrollHeight + 30
|
floatTop = $tags.offsetTop + $tags.scrollHeight + 30
|
||||||
// }
|
}
|
||||||
|
|
||||||
function addEvent (obj, type, fn) {
|
function addEvent (obj, type, fn) {
|
||||||
if (obj.attachEvent) {
|
if (obj.attachEvent) {
|
||||||
@ -25,35 +25,35 @@ window.onload = function () {
|
|||||||
alert('您的浏览器版本过低,继续访问将会出现问题,请升级浏览器版本!') // eslint-disable-line
|
alert('您的浏览器版本过低,继续访问将会出现问题,请升级浏览器版本!') // eslint-disable-line
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 底部返回顶部按钮
|
// 底部返回顶部按钮
|
||||||
// const top = document.getElementById('gotop')
|
const top = document.getElementById('gotop')
|
||||||
// if (top) {
|
if (top) {
|
||||||
// // 滚动一屏幕时显示回到顶部
|
// 滚动一屏幕时显示回到顶部
|
||||||
// addEvent(window, 'scroll', function () {
|
addEvent(window, 'scroll', function () {
|
||||||
// const currentPosition = document.documentElement.scrollTop || document.body.scrollTop
|
const currentPosition = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
// currentPosition > window.screen.availHeight ? top.style.display = 'block' : top.style.display = 'none'
|
currentPosition > window.screen.availHeight ? top.style.display = 'block' : top.style.display = 'none'
|
||||||
|
|
||||||
// // 左部导航自动浮动
|
// 左部导航自动浮动
|
||||||
// if (currentPosition > floatTop && document.body.clientWidth > 768) {
|
if (currentPosition > floatTop && document.body.clientWidth > 768) {
|
||||||
// document.getElementById('navication').style.position = 'fixed'
|
document.getElementById('navication').style.position = 'fixed'
|
||||||
// } else {
|
} else {
|
||||||
// document.getElementById('navication').style.position = 'static'
|
document.getElementById('navication').style.position = 'static'
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
|
||||||
// top.onclick = function () {
|
top.onclick = function () {
|
||||||
// var timer = setInterval(function () { // eslint-disable-line
|
var timer = setInterval(function () { // eslint-disable-line
|
||||||
// let currentPosition = document.documentElement.scrollTop || document.body.scrollTop
|
let currentPosition = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
// currentPosition -= 100
|
currentPosition -= 100
|
||||||
// if (currentPosition > 0) {
|
if (currentPosition > 0) {
|
||||||
// window.scrollTo(0, currentPosition)
|
window.scrollTo(0, currentPosition)
|
||||||
// } else {
|
} else {
|
||||||
// window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
// clearInterval(timer)
|
clearInterval(timer)
|
||||||
// }
|
}
|
||||||
// }, 10)
|
}, 10)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
let _hmt = _hmt || [] // eslint-disable-line
|
let _hmt = _hmt || [] // eslint-disable-line
|
||||||
const hm = document.createElement('script')
|
const hm = document.createElement('script')
|
||||||
|
Loading…
Reference in New Issue
Block a user