赞
踩
- // 滚动条监听事件 将滚动条的scrollLeft 赋给下方的DIV
- handleScroll() {
- let goodsArrDiv = document.body.getElementsByClassName("goodsArrDiv")[0];
- let parentNewScrollBar = document.getElementById("parentNewScrollBar");
- this.$nextTick(() => {
- let goodsArrDiv = document.body.getElementsByClassName(
- "goodsArrDiv"
- )[0];
- goodsArrDiv.scrollLeft = parentNewScrollBar.scrollLeft;
- });
- },
-
- // 将需要滚动的滚动条宽度赋给新滚动条
- setNewScrollBar() {
- setTimeout(() => {
- let goodsArrDiv = document.getElementsByClassName("goodsArrDiv")[0];
- let newScrollBar = document.getElementById("newScrollBar");
- if (newScrollBar) {
- newScrollBar.style.width = goodsArrDiv.scrollWidth + "px";
- }
- }, 500);
- },
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。