jRange
jRange copied to clipboard
Labels do not work with relative widths
The 'left' attribute on the labels will never be assigned when the initialized width value is, for example, 100%
. Similar to (closed) #11.
Can be replicated with this:
$('.slider-input').jRange({
from: 13,
to: 65,
step: 1,
scale: [13,25,50,'65+'],
format: '%s',
width: '100%',
showLabels: true,
isRange : true
});
The slider is still useless when slider is set to be 100% wide.
I fixed this removing width: '100%'
from the options, after that, I setting width: '100%'
and resize it.
$('.slider-input').jRange({
from: 13,
to: 65,
step: 1,
scale: [13,25,50,'65+'],
format: '%s',
showLabels: true,
isRange : true
});
$('.slider-container').css('width', '100%');
$('.slider-input').trigger('resize');