2018年8月8日

滑到底部时,处理一些事件

摘要: function addScrollEvent() { let canScroll = true; function isScrollToPageBottom() { let docHeight = document.documentElement.offsetHeight; let viewHeight = win... 阅读全文

posted @ 2018-08-08 15:19 郭“老师" 阅读(129) 评论(0) 推荐(0)

回到顶部实现

摘要: document.getElementById('top').onclick = function () { // top为元素即点击id为top元素时实现回到顶部 // console.time('label'); for (let i = 60; i >= 0; i--) { setTimeout((i => { ... 阅读全文

posted @ 2018-08-08 14:59 郭“老师" 阅读(129) 评论(0) 推荐(0)

地址栏添加参数

摘要: 传一个对象进去,通过方法解析后即可直接跟在url参数后面 阅读全文

posted @ 2018-08-08 14:52 郭“老师" 阅读(922) 评论(0) 推荐(0)

页面滚动到某一特定元素触发事件

摘要: 1.下载IntersectionObserver包 2.引入包封装一个方法 3.应用 IntersectionObserver源代码 地址:https://github.com/w3c/IntersectionObserver/blob/master/polyfill/intersection-ob 阅读全文

posted @ 2018-08-08 14:45 郭“老师" 阅读(1899) 评论(0) 推荐(0)

导航