jQuery Mobile 滑块无限循环
我有一个通过网络更新的 jquery 移动滑块。
<input type="range" id="slider" class="slider osc" value="0" min="0" max="1" step="0.01" />
我通过套接字接收新值,并且我想更新我的滑块。当我接收数据时,滑块不会停止在其值和接收到的值之间循环。有什么想法吗?
socket.on('osc', function (data) {
console.log('osc' , data);
$("#slider").val(data.msg).slider('refresh') ;
});
I have a jquery mobile slider updated by network.
<input type="range" id="slider" class="slider osc" value="0" min="0" max="1" step="0.01" />
I receive new values by a socket, and I want to update my slider. When I receive data, the slider doesn't stop looping between its value and the one it receives. Any ideas?
socket.on('osc', function (data) {
console.log('osc' , data);
$("#slider").val(data.msg).slider('refresh') ;
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不刷新滑块,而是调用 jqm 页面本身上的
.page()
方法是否有效?该解决方案在论坛上的类似帖子中提供 - http://forum.jquery.com/topic/how-to-dynamically-change-the-value-of-a-slider
Instead of refreshing the slider, would it work to call the
.page()
method on the jqm page itself?This solution was offered in a similar post on the forum - http://forum.jquery.com/topic/how-to-dynamically-change-the-value-of-a-slider