html5 steps 插件,Javascript/HTML 5 Slider steps issue

I have a HTML 5 Slider that is basically designed (or should be) to change the width of the line in the canvas im painting app im creating. However I have a issue. On moving the slider from initial position it jumps to the middle i.e. 5 and then is stuck there, removing all the steps numbers 1-10 in between. Below is the code I have:

HTML:

1

JS:

function brushWidth()

{

var varWidth = document.getElementById('penwidth').value;

context.lineWidth = varWidth;

document.getElementById("penwidth").value = newValue;

}

When the slider is in the 1 (default position the line I daw is 1 width and when i move it and it jumps to position 5 the line is a width of 5 so I know that it works fine its just the slider having a problem. If I remove the following from the HTML code the slider moves in steps fine but obviously does nothing:

οnchange="this.value='';"

I have uploaded the files to my server so you can see whats going on im using Chrome also - http://marksblog.co.uk/canvas/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值