Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自定义jQuery UI滑块高度&;宽度_Jquery_Css_Jquery Ui_Slider - Fatal编程技术网

自定义jQuery UI滑块高度&;宽度

自定义jQuery UI滑块高度&;宽度,jquery,css,jquery-ui,slider,Jquery,Css,Jquery Ui,Slider,自定义jQueryUI滑块(和句柄)的高度/宽度时,句柄现在将向左滑动太远(远离滑块)。有没有一种推荐的方法可以做到这一点 这里有一把小提琴向你展示我的意思: 我在中没有看到关于此的任何内容,我使用的是一个非常基本的设置: $("#slider").slider({ orientation: "horizontal", max: 100, min: 0 }); 试一试 要将滑块放入条内,请添加左填充:5pxJQuery UI滑块的单位大小在em中。因此,滑块大小与其

自定义jQueryUI滑块(和句柄)的高度/宽度时,句柄现在将向左滑动太远(远离滑块)。有没有一种推荐的方法可以做到这一点

这里有一把小提琴向你展示我的意思:

我在中没有看到关于此的任何内容,我使用的是一个非常基本的设置:

$("#slider").slider({
    orientation: "horizontal",
    max: 100,
    min: 0
});
试一试



要将滑块放入条内,请添加
左填充:5px

JQuery UI滑块的单位大小在
em
中。因此,滑块大小与其字体大小有关

  • 更改滑块div的字体大小以处理滑块高度
  • 将滑块的容器宽度更改为控制滑块宽度

@lhan16欢迎您的帮助:)您的示例位于左侧,而不是右侧(整个手柄宽度)
.ui-slider .ui-slider-handle {
    height: 15px;
    width: 5px;
    padding-left: 5px; //add this
}
$(document).ready(function() {   
    function home_page_banner_height(selector) {   
        var wind_widht = $( window ).width();   
        var req_height = ( (banner_height / banner_width) * 100 );   
        //banner_height is height of item div of carousel and banner_width is width of item div of caousel 

        var calculate_height = (wind_widht / 100) * req_height;
        $('.v_center_con .v_center_inner').height(calculate_height);     
        $(selector).height(calculate_height);     
    }

    home_page_banner_height('.banner_con .item');     

    $(window).resize(function() {     
        home_page_banner_height('.banner_con .item');           
        //this function will make your slider responsive for all screen sizes
    });
});