When customizing the height/width of the jQuery UI Slider (and handle), the handle will now slide too far left (off of slider). Is there a recommended way of going about doing this?
Here's a fiddle to show you what I mean: http://jsfiddle.net/w7A4k/
I didn't see anything in the API Documentation for this, and I'm using a very basic setup:
$("#slider").slider({
orientation: "horizontal",
max: 100,
min: 0
});
Try
.ui-slider .ui-slider-handle {
height: 15px;
width: 5px;
padding-left: 5px; //add this
}
padding-left: 5px;
Unit size of JQuery UI Slider is in em
. Therefore slider size is relative to its font size.
$(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
});
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.