jQuery UI Range滑块错误? [英] jQuery UI Range slider bug?

查看:109
本文介绍了jQuery UI Range滑块错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jQuery UI滑块上遇到了一个有趣的问题.我需要从sript分配其最小值和最大值,并且正在执行以下操作

I have run into an interesting issue with the jQuery UI slider. I need to assign its min and max values from sript and am doing the following

$("#sliCSSHt").slider('values',[minh,maxh]);
$("#sliCSSHt").slider('refresh');

当minh = maxh时出现问题. MIN(最小)按钮似乎位于顶部,位于max(最大)按钮的顶部.然后尝试增加最大值的无辜用户发现滑块实际上没有响应,因为他/她实际上将最小按钮拖动到了最大按钮的当前位置之外.如果能做些什么来解决这个问题怎么办?

The problem arises when minh = maxh. The MIN button appears to go and sit on TOP of the max button. The innocent user who then tries to inrease the max value finds that the slider has beome unresponsive since he/she is actually dragging the min button beyond the current position of the max button. What if anything can be done to get round this?

我将jQuery UI 1.91与jQuery 1.82结合使用-我无法选择升级到jQuery 1.9,因为我使用的插件使用的浏览器对象现已从jQuery中删除.

I am using jQuery UI 1.91 with jQuery 1.82 - I don't have the option of moving up to jQuery 1.9 since I am using plugins that use the browser object which has now been taken out of jQuery.

推荐答案

您总是可以阻止滑块重叠.像

You could always stop the sliders from overlapping. Something like

$( "#sliCSSHt" ).on( "slide", function( event, ui ) {
    if(ui.values[0]+10 > ui.values[1])  
       return false;
} );

http://jsfiddle.net/c934g/5/

更新 此错误已在最新的jquery-ui

Update This bug is fixed in the latest jquery-ui

使用最新的jquery-ui文件http://code.jquery.com/ui/1.10.3/jquery-ui.js可以正常工作.

using the latest jquery-ui files http://code.jquery.com/ui/1.10.3/jquery-ui.js it works.

http://jsfiddle.net/c934g/7/

这篇关于jQuery UI Range滑块错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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