我希望我的滑块上的工具提示只显示"130"而不是"130.00"这样的整数.我只是不知道我可以从哪里开始.
这是我的代码:
$( document ).ready(function() {
var groesseslider = document.getElementById('slider-tooltip');
noUiSlider.create(groesseslider, {
start: [ 145 ],
step: 1,
range: {
'min': 100,
'max': 250
}
});
});
$( document ).ready(function() {
var groesseslider = document.getElementById('slider-tooltip');
var tipHandles = groesseslider.getElementsByClassName('noUi-handle'),
tooltips = [];
// Add divs to the slider handles.
for ( var i = 0; i < tipHandles.length; i++ ){
tooltips[i] = document.createElement('div');
tipHandles[i].appendChild(tooltips[i]);
}
// When the slider changes, write the value to the tooltips.
groesseslider.noUiSlider.on('update', function( values, handle …Run Code Online (Sandbox Code Playgroud) 我无法使用noUISlider来工作,这里是我的代码段:
<script>
var handlesSlider = document.getElementById('slidertest');
noUiSlider.create(handlesSlider, {
start: [ 4000, 8000 ],
range: {
'min': [ 2000 ],
'max': [ 10000 ]
}
});
</script>Run Code Online (Sandbox Code Playgroud)
<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>Run Code Online (Sandbox Code Playgroud)
我收到此错误:未捕获的TypeError:无法读取null的属性'nodeName'
我正在尝试使用以下代码从 SCEditor 文本区域获取值:
var fbeschreibung = '';
$(function() {
// Replace all textarea's
// with SCEditor
$("textarea").sceditor({
plugins: "bbcode",
style: "css/style.less",
width: "100%",
toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|size,color,removeformat|bulletlist,orderedlist,horizontalrule,emoticon",
locale:"de" ,
resizeEnabled:false
});
fbeschreibung = $('textarea').sceditor('instance').val();
$('textarea').sceditor('instance').val('Hello [b]World![/b]');
});
Run Code Online (Sandbox Code Playgroud)
然后我想通过 AJAX 发送该值:
$.post('saveprofile.php',
{fbeschreibung : fbeschreibung},
function (response) {
alert(response);
}
);
Run Code Online (Sandbox Code Playgroud)
但是,我无法让它发挥作用。我在文档中没有找到任何提示:http://www.sceditor.com/api/sceditor/val/
我的变量fbeschreibung只是空的。我是不是做错了什么?