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;

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题