在jQuery Mobile中检测选择滑块更改事件 [英] Detecting select slider change event in jQuery Mobile

查看:97
本文介绍了在jQuery Mobile中检测选择滑块更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是检测jQuery Mobile中选择滑块的更改的可靠方法?我尝试绑定一个处理程序来更改选择控件本身的事件,但是在初始页面显示时触发,然后在点击次数上触发多次,有时甚至在悬停(在桌面浏览器中)触发。



此行为的最小工作示例发布于此: http:// jsfiddle。 net / NPC42 / mTjtt / 3 /



这可能是由jQuery Mobile添加更多元素来将选择作为翻页切换,但我可以没有找到推荐的方法。



非常感谢任何帮助。

解决方案

可能不是最光滑的解决方案,但它的工作原理是
http://jsfiddle.net / mTjtt / 4 /


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 works http://jsfiddle.net/mTjtt/4/

这篇关于在jQuery Mobile中检测选择滑块更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆