jQuery mobile-滑动停止功能 [英] jquery mobile - slide stop function

查看:118
本文介绍了jQuery mobile-滑动停止功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我停止滑动Jquery Mobile Slide时,我将运行一个函数.

I would run a function when I stop to slide the Jquery Mobile Slide.

我有这张幻灯片:

<div data-role="fieldcontain">
    <fieldset data-role="controlgroup" data-mini="true">
    <label for="slider2">
       Test
    </label>
             <input type="range" name="slider" id="testslider" value="0" min="-50" max="50" data-highlight="true" />
    </fieldset>
</div>

和这个Javascript:

And This Javascript:

$(function() {
    $( "#slider2" ).bind( "stop", function(event, ui) {
        alert("Stop");
    });      
});

但是它不起作用!

释放鼠标(手指)时如何运行功能?

How I can run a function when I release the mouse (finger)??

推荐答案

正确的方法如下:

$("#slider2").on(
   'slidestop',
   function(event) {
      // Code goes here
   }
);

这篇关于jQuery mobile-滑动停止功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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