jquery mobile - slide stop function

本小妞迷上赌 提交于 2019-12-08 01:55:10

问题


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

I have this 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>

And This Javascript:

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

But It don't work!

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


回答1:


The right method is the following:

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


来源:https://stackoverflow.com/questions/10898958/jquery-mobile-slide-stop-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!