jQuery滑块的slide事件无法正常工作

罗什娜

我正在使用jQuery滑块,在其Slide事件中,我编写了一些要执行的代码。

它仅在我缓慢滚动滑块时运行,而当使用鼠标快速滚动滑块时,slide事件中的代码将不会执行。

这是我的代码:

$( "#master" ).slider({
    value: 0,
    orientation: "horizontal",
    range: "min",
    step:1,
    animate: false,
    slide: function( event, ui ) { 
        /*the below will not execute when slider scrolled faster */
        $( "#ratvalue" ).val( ui.value+"%" );
        var ratval=ui.value;
        console.log(ratval);
        progNew("#master", ratval, 100);
      }
 });
雷米·穆拉利(Remya Murali)

用这个:

$( "#master" ).slider({
    value: 0,
    orientation: "horizontal",
    range: "min",
    step:1,
    animate: false,
    stop: function( event, ui ) { 
        /*the below will work */
        $( "#ratvalue" ).val( ui.value+"%" );
        var ratval=ui.value;
        console.log(ratval);
        progNew("#master", ratval, 100);
      }
 });

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章