5

我无法让 noUISlider 工作这里我的代码片段:

<script>
var handlesSlider = document.getElementById('slidertest');

noUiSlider.create(handlesSlider, {
	start: [ 4000, 8000 ],
	range: {
		'min': [  2000 ],
		'max': [ 10000 ]
	}
});
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>    
<link rel="stylesheet/less" type="text/css" href="css/style.less"/>
<link href="css/nouislider.min.css" rel="stylesheet">
<script src="scripts/less.js"> </script>
<script src="scripts/jquery-2.1.4.min.js"> </script>
<script src="scripts/jquery-ui.min.js"> </script>
<script src="scripts/dropzone.js"> </script>
<script src="scripts/nouislider.min.js"> </script>
</head>



...

<div id="slidertest"></div>

我收到此错误:未捕获的类型错误:无法读取 null 的属性“nodeName”

4

1 回答 1

5

尝试围绕你的javascript:

$( document ).ready(function() {
    var handlesSlider = document.getElementById('slidertest');

noUiSlider.create(handlesSlider, {
    start: [ 4000, 8000 ],
    range: {
        'min': [  2000 ],
        'max': [ 10000 ]
    }
});
});
于 2015-07-24T01:08:13.517 回答