jRange icon indicating copy to clipboard operation
jRange copied to clipboard

Labels do not work with relative widths

Open gavinsmith opened this issue 9 years ago • 2 comments

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
  });

gavinsmith avatar Jan 23 '15 15:01 gavinsmith

The slider is still useless when slider is set to be 100% wide.

mikemix avatar Mar 22 '19 12:03 mikemix

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');

silasrnc avatar Oct 06 '20 15:10 silasrnc