为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

拉风的咖菲猫 2019-03-13 17:12:42
const minwidth = (this.$refs.progress.clientWidth / barwidth + this.percentum) * this.percentmax // 10 - 90const maxwidth = this.$refs.progress.clientWidth / barwidth * this.percentmax // 0 - 80minwidth 滑动取到的是10-90,maxwidth 滑动取到的是0-80 ,怎么取10-80
查看完整描述

1 回答

?
摇曳的蔷薇

TA贡献1793条经验 获得超6个赞

minwidth = (minwidth-10) * (8/9) + 10;

maxwidth = maxwidth * (8/9) + 10;

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


查看完整回答
反对 回复 2019-03-16
  • 1 回答
  • 0 关注
  • 502 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号