我想创建一个可拖动的div。我想知道如何改进浏览器渲染和平滑结果。
reactJS
$current n = 0;
if (!$solvemedia_response->is_valid) {
print "<div class='alert alert-danger'> Captcha wrong try again!: ".$solvemedia_response->error."</div>";
$currentn +=0;
echo $currentn;
}else {
print "<div class='alert alert-success'> 100 satoshis have been earned successfuly </div>";
$currentn +=100;
echo $currentn;
}
HTML
mouseDown() {
this.setState({
thumbActive: true,
});
},
mouseUp() {
this.setState({
thumbActive: false,
});
},
mouseMove(e) {
if(!this.state.thumbActive) {
return;
}
const y = e.nativeEvent.offsetY;
this.setState({
topPosition: y,
});
},