2013-07-16 51 views

回答

1

如果我没有记错,你不能覆盖它,除非你愿意改变JQM的源代码。

作为该行为来源的线在函数refresh中。更确切地说以下块:

if (typeof val === "object") { 
    data = val; 
    // a slight tolerance helped get to the ends of the slider 
    tol = 8; 
    left = this.slider.offset().left; 
    width = this.slider.width(); 
    pxStep = width/((max-min)/step); 
    if (!this.dragging || 
     data.pageX < left - tol || 
     data.pageX > left + width + tol) { 
      return; 
    } 
    if (pxStep > 1) { 
     percent = ((data.pageX - left)/width) * 100; 
    } else { 
     percent = Math.round(((data.pageX - left)/width) * 100); 
    } 
} 

在用鼠标/ TAP的interraction的情况下,VAL是一个对象,你的情况pxStep不如1。所以,我们有全面进入行动。

P.S:不能完全肯定是我写的,它只是曾在代码中的一瞥,但在我看来,它这样的行为。

+0

谢谢你!我正要深挖在此之后的核心,但你在那里吧,我已经禁用的百分比步检查现在一边想着一个更全面的解决方案(修改数学)。 – SK1986