我正在尝试在文本框中显示滑块更改值的结果,但是我不知道该怎么做。代码是:
s
slider = widget.getByName("Slider1");
slider.addValueChangedHandler(
function (sender, e) {
alert(sender.getValue());
}
)
}
HTML
</head>
<body>
<div style="clear: both; margin-top: 0px; margin-bottom: 0px; "></div>
<div class="cell" style="height:100px">
<div class="container" style="height: 100px; margin-bottom: 0px;">
<div class="widget" style="height: 150px; margin-bottom: 0px;" id="root">
</div>
</div>
</div>
<div><input type="text" id="ValueBox" value="0"/></div>
</body>
</html>
在此先感谢您的帮助。
最佳答案
脚本
slider = widget.getByName("Slider1");
slider.addValueChangedHandler(
function (sender, e) {
document.getElementById("ValueBox").value=sender.getValue();
}
)
}
</script>
的HTML
</head>
<body>
<div style="clear: both; margin-top: 0px; margin-bottom: 0px; "></div>
<div class="cell" style="height:100px">
<div class="container" style="height: 100px; margin-bottom: 0px;">
<div class="widget" style="height: 150px; margin-bottom: 0px;" id="root">
</div>
</div>
</div>
<div><input type="text" id="ValueBox" value="0"/></div>
</body>
</html>