jQueryMobile: how to work with slider events?

后端 未结 9 1479
南方客
南方客 2020-12-09 05:32

I\'m testing the slider events in jQueryMobile and I must been missing something.

page code is:

9条回答
  •  余生分开走
    2020-12-09 06:05

    If you want to just catch the event when the slider is released (most probably to optimize ajax requests).

    This worked for me:

    var slider = $('#my_slider');
    //as the answer from @nskeskin you have to remove the type range from your input on the html code
    slider.slider({create:function(){
        //maybe this is too much hacking but until jquery provides a reference to this...
        $(this).next().children('a').bind('vmouseup', yourOnChangeCallback);
    }
    });
    

    Also this prevents that you add events when the control is not yet initialized (or created), so waiting for the create event is a bit more correct I think.

提交回复
热议问题