ui滑块重叠的滑块无法拖动 [英] ui-slider overlapping slider impossible to drag

查看:97
本文介绍了ui滑块重叠的滑块无法拖动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在1.9.2中使用默认的ui-slider时,两个把手碰撞时会出现一个小问题,无法拖动右侧把手.

When using the default ui-slider in 1.9.2 there is a smal problem when the two handlebars collide, its impossible to drag the right handlebar.

查看此处: http://jqueryui.com/slider/#range

将两个把手放在一起,然后尝试增加较高的值,不起作用.

Put the two handlebars together, then try to increase the higher value, not working.

然后我发现了这篇文章:

Then I found this post:

https://stackoverflow.com/a/4254932/1905754

这是一个解决方案,但它适用于1.8.6,因此我找不到要在1.9.2中进行编辑的代码行.有人知道1.9.2是否有类似的解决方案吗?

This is a solution but its to 1.8.6 so I dont find those code rows to edit in 1.9.2. Does anybody know if there is a similiar solution to 1.9.2?

谢谢.

对不起,英语不正确.

推荐答案

这不是永久性的解决方法,但有助于使滑块可拖动.

This is not a permanent fix but helpful to make slider draggable agian.

$('#slider-range').slider
  start: (event, ui) ->
    # Only when sliders are overriding
    if ui.values[0] == ui.values[1]
      set_min = ui.values[0] - 0.1
      set_max = ui.values[1]
      # Deducing value of left slider by 0.1(or you can give step value based on your condition)
      $('#slider-range').slider('values', [set_min,set_max])
      return false
   slide: (event, ui) ->
     # Some statements
   stop: (event, ui) ->
     # Some statements

这篇关于ui滑块重叠的滑块无法拖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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