Pure-Knob 如何将刻度盘值从 100 设置为 0,而不是 0 到 100,与鼠标单击和鼠标滚动交互
当前knob.setProperty('valMin',0);和knob.setProperty('valMax',100);定义它创建一个从 0 到 100 的旋钮起始值。但我想要一个从 100 到 0 开始的旋钮,如下 Knob.setProperty('valMin',100);和knob.setProperty('valMax',0); 提前致谢。检查 GitHub 链接将受到高度赞赏。
https://github.com/andrepxx/pure-knob
const knob = pureknob.createKnob(300, 300);
knob.setProperty('angleStart', -0.75 * Math.PI);
knob.setProperty('angleEnd', 0.75 * Math.PI);
knob.setProperty('colorFG', '#88ff88');
knob.setProperty('trackWidth', 0.4);
knob.setProperty('valMin', 0);
knob.setProperty('valMax', 100);
knob.setValue(50);
const listener = function(knob, value) {
console.log(value);
};
knob.addListener(listener);
const node = knob.node();
const elem = document.getElementById('some_element');
elem.appendChild(node);
Currently knob.setProperty('valMin',0); and knob.setProperty('valMax',100); is defined which creates a knob starting value from 0 to 100.But I want a knob which will start from 100 to 0 as following knob.setProperty('valMin',100); and knob.setProperty('valMax',0);
Thanks in advance. Checking the GitHub link will be highly appreciated.
https://github.com/andrepxx/pure-knob
const knob = pureknob.createKnob(300, 300);
knob.setProperty('angleStart', -0.75 * Math.PI);
knob.setProperty('angleEnd', 0.75 * Math.PI);
knob.setProperty('colorFG', '#88ff88');
knob.setProperty('trackWidth', 0.4);
knob.setProperty('valMin', 0);
knob.setProperty('valMax', 100);
knob.setValue(50);
const listener = function(knob, value) {
console.log(value);
};
knob.addListener(listener);
const node = knob.node();
const elem = document.getElementById('some_element');
elem.appendChild(node);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需更改属性:
just change properties: