how to set html5 slider defaults from localStorage?

I'm using pure html5 sliders as such:
Brush Size:
Then saving the values into localStorage onChange: $("#brush_size").change(function(){ localStorage['brush_size']=this.value; }); $("#opacity").change(function(){ localStorage['opacity']=this.value; }); After changes, on the next page load I would like to see the current localStorage values, instead of the html hardcoded values. What's the best way of doing this? I suppose I could set the slider's value to the localStorage values during page load using jQuery... is this the best-practices way of doing it?

以上就是how to set html5 slider defaults from localStorage?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准