我试图在文本框中显示滑块更改值的结果,但我不知道该怎么做。代码是:
的js
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>
提前感谢您的帮助。
答案 0 :(得分:1)
<强>脚本强>
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>