jQRangeSlider icon indicating copy to clipboard operation
jQRangeSlider copied to clipboard

dateRangeSlider - differences in browser sub-pixel rendering throws off scales

Open lukemcd opened this issue 11 years ago • 2 comments

Different browsers user different methods to convert percentage widths into pixels. Safari and IE round down to the pixel, Firefox and Chrome do a better job of rounding to the nearest pixel. For range sliders with extended date ranges the slider area will noticeably exceed beyond the last month in some browsers.

You can view this demo in Safari vs. Firefox to see the difference: http://jsfiddle.net/lukemcd/tbV8e/

This could be viewed as a browser bug but I think if jQRangeSlider did it's own conversion of percentages to pixels the plugin could guarantee more consistent results.

lukemcd avatar Apr 17 '13 14:04 lukemcd

Thanks for your clear example.

I don't want the plugin to calculate pixels itself: it's very useful to rely on percentages when user resizes the window, hides/shows the slider etc.

But I think there is another solution, consisting in positioning every tick absolutely, with a left margin defined in %

ghusse avatar Apr 17 '13 19:04 ghusse

I figured the percentages were best for resizing. Your solution seems like a sensible way to handle it.

lukemcd avatar Apr 17 '13 22:04 lukemcd