简体   繁体   中英

Elessar - fix touch events

Just been trying to get multiple ranges working using elessar

Its a great library although not well documented. I got everything going but it doesn't seem to work on touch devices. No error thrown in the console either.

Can someone help me fix it.

Here is an example:

var r = new RangeBar({
  min: 0,
  max: 100,
    /*readonly: true,*/
  values: [
    [0, 4],
    [10, 14]
  ],
    valueFormat: function(a) {return a.toFixed(1)},
  valueParse: function(a) {return parseInt(a)},
  snap: 0.1,
  minSize: 0.5,
  barClass: 'bar',
  rangeClass: 'bar-range',
  allowDelete: true
});
$('[role=main]').prepend(r.$el).on('changing', function(ev, ranges) {
  $('pre.changing').html('changing ' + JSON.stringify(ranges, null, 2));
}).on('change', function(ev, ranges) {
  $('pre.changing').after($('<pre>').html('changed ' + JSON.stringify(ranges, null, 2)));
});

http://codepen.io/praneybehl/pen/MYXVEx

Thanks in advance

This was a bug in Elessar. It's fixed in version 1.8.4.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM