_Note for search-engine visitors:_
None of the problems and issues described here are relevant to the current version of noUiSlider, as it got a massive update. Find it here: documentation.
_Original post:_
When I saw your page and all these sliders, I immediately felt in love with noUiSlider. I even wrote a quick article about it (not yet published), without even trying it. And that was a mistake, as either I'm blind / I'm doing something really, really wrong or current version of your slider does not work at all.
Generated slider is invisible. Upon checking page, I clearly see, that main div
has width
set to 100%
and height to 0px
. While a
inside it has both width
and height set to 0px
.
At first, I thought, that this is because I packed it into mobile application and something is wrong with pixel-per-inch setting. Or, that it interfere somehow with Twitter Bootstrap, that I use. Or, there are million reasons on my side, that caused this to not work.
But then, I've created sample document, as simple as:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="nouislider-3.2.1.min.css" rel="stylesheet" />
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="nouislider-3.2.1.min.js"></script>
</head>
<body>
<div id="positionSlider"></div>
<script type="text/javascript">
/*<![CDATA[*/
$(function($)
{
$("#positionSlider").noUiSlider
({
range: [0, 100],
start: 50,
handles: 1,
connect: "lower"
});
});
/*]]>*/
</script>
</body>
</html>
I feed it with files found at GitHub and official minified jQuery 1.9.1 release.
Then I tested it in Chrome 28
, Internet Explorer 10
and Firefox 22
. None of these browsers was able to display your slider correctly and dev tools on-board all of these browsers has reported, that your slider is indeed created, but it is sized to 0 pixels.
I even forced myself to do things as weird as:
$("#positionSlider").noUiSlider
({
range: [0, 100],
start: 50,
handles: 1,
connect: "lower"
});
$('#positionSlider a').css('width', '100%');
$('#positionSlider a').css('height', '8px');
But this also hasn't brought any result. Size of your slider is non-zero, but it contents remains empty (invisible) -- for the reasons beyond my imagination.
I tried to replace github-versions of files with the one on your website (were sliders are working just fine), but again, without any luck.
As a last example of despair, I saved local copy of your website. In the result, I got sliders at least visible, but with many visual errors (two knobs, where there should be one and three of four, where there should be two) and partially-non working (additional knobs, that appears in center of each slider are not draggable / movable).
See picture below:
As I wrote, I really enjoy your library, and I would like to use it as much as possible. But currently, it isn't possible, as it isn't working at all (at least for me). I really would like to know, what am I missing or doing wrong, and why does this works perfectly on your website, but fails completely locally, on any project, that I tested it with?