我想要做的就像代码:当值大于10,显示> 10,或显示1 - 10。它工作正常。但是,如果我取消注释jquery手机,它不再工作。jQuery Mobile:如何获取范围滑块的更改事件?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!--<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>-->
</head>
<body>
<form>
<label for='range'>as</label>
<input id='range' type='range' onmousemove='test()'>
<p id='display'>display</p>
</form>
<script>
function test(){
var v = $('#range').val();
if(v <= 10)$("#display").text('1-10');
else $("#display").text('>10');
}
</script>
</body>
</html>
在你看到控制台的任何具体的错误? –
试过了,适合我吗?究竟是什么问题? –
如果您取消注释行#7 <脚本src =“https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”>,则它不再起作用 – user7873949