易学问答
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 更多
    • 积分规则
登录 或 注册
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 积分规则
 发表新帖
发表新帖

jQuery Mobile: how to get the change event of a range Slider?

后端 未结
关注
 2  1572
走了就别回头了
走了就别回头了 2020-12-21 20:27

What I am trying to do is just like the code: when the value is greater than 10, display >10, or display 1 - 10. It works fine. However, if I uncomment the jquery mobile , i

2条回答
  •  旧巷少年郎
    旧巷少年郎 (楼主)
    2020-12-21 20:56

    There are three JQM slider events available after widget initialization:

    • slidestart
    • change
    • slidestop

    To get the correct behavior, you should provide the correct JQM page structure and register the event handlers inside the pagecreate event. Below is a simple stub where you can test a JQM slider:

    $(document).on("pagecreate", "#page-one", function() {
      $("#slider").on("slidestart", function() {
        var val = $(this).val();
        $("#txt1").val(val);
      });
      $("#slider").on("change", function() {
        var val = $(this).val();
        $("#txt2").val(val);
      });
      $("#slider").on("slidestop", function() {
        var val = $(this).val();
        $("#txt3").val(val);
      });
    });
    
    
    
      
      
      
      
      
    
    
      

    0 讨论(0)
    查看其它2个回答
    提交评论

    •  加载中...
 看不清?
提交回复
热议问题