Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery移动滑块事件未触发_Jquery_Jquery Mobile_Jquery Slider - Fatal编程技术网

Jquery移动滑块事件未触发

Jquery移动滑块事件未触发,jquery,jquery-mobile,jquery-slider,Jquery,Jquery Mobile,Jquery Slider,我想使用jquery滑块(在移动设备上)更改DIV的比例。代码非常简单,可以在jsfiddle()上运行,但由于某些原因,不能在普通html页面上运行。有人能帮我找出原因吗 这是html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://w

我想使用jquery滑块(在移动设备上)更改DIV的比例。代码非常简单,可以在jsfiddle()上运行,但由于某些原因,不能在普通html页面上运行。有人能帮我找出原因吗

这是html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Testing</title>


    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js">      </script>
</head><body>

<div data-role="fieldcontain"><input type="range" name="slider" id="slider" value="60" min="0" max="100" /></div>

<script>
$("#slider").change(function() { 
sliderValue =    $(this).val();$("#proportion").width(sliderValue*3);
$("#proportion").height(300-sliderValue*3);});
</script>

<div id="proportion" style="border:1px solid #ccc; width:150px; height:150px;" /></div>
</body>
</html>

测试
$(“#滑块”).change(函数(){
sliderValue=$(this.val();$(“#比例”).width(sliderValue*3);
$(“#比例”)。高度(300滑块值*3);});
输入:

$("#slider").change(function() {
$(document).ready(function() {
// here
});