js滑块取最大值和最小值问题

const minwidth = (this.$refs.progress.clientWidth / barwidth + this.percentum) * this.percentmax // 10 - 90

const maxwidth = this.$refs.progress.clientWidth / barwidth * this.percentmax // 0 - 80

minwidth 滑动取到的是10-90,maxwidth 滑动取到的是0-80 ,怎么取10-80

阅读 2.4k
1 个回答
minwidth = (minwidth-10) * (8/9) + 10;
maxwidth = maxwidth * (8/9) + 10;

可以拿已知的这个范围通过计算换算成目标范围啊

推荐问题