Bugfix: the type of data attributes is string even if they contain a number so I updated the code to parse the data attributes correctly

The type of data attribute is string so if you write the following code:

console.log(typeof $("#slider").data("min")); // this will print "string"

so the existing code would not work. I have updated the code to parse the data attributes not as strings but as numbers.