问题描述
什么是检测jQuery Mobile中选择滑块的更改的可靠方法?我尝试绑定一个处理程序来更改选择控件本身的事件,但是在初始页面显示时触发,然后在点击次数上触发多次,有时甚至在悬停(在桌面浏览器中)触发。此行为的最小工作示例发布于此:
这可能是由jQuery Mobile添加更多元素来将选择作为翻页切换,但我可以没有找到推荐的方法。
非常感谢任何帮助。
可能不是最光滑的解决方案,但它的工作原理是
What is a reliable way to detect change of a select slider in jQuery Mobile? I try to bind a handler to change event of the select control itself, but it fires on initial page display, and then fires multiple times on clicks, and sometimes even on hover (in desktop browser).
The minimal working example of this behaviour is posted here: http://jsfiddle.net/NPC42/mTjtt/3/
This is probably caused by jQuery Mobile adding more elements to style the select as the flip-toggle, but I can't find the recommended way to do it.
Any help is much appreciated.
May not be the slickest solution but it workshttp://jsfiddle.net/mTjtt/4/
这篇关于在jQuery Mobile中检测选择滑块更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!