我正在使用 jQuery Mobile 制作一个 HTML5 应用程序,并且我刚刚在应用程序中添加了触摸打孔功能。该网站 ( http://touchpunch.furf.com/ ) 在我的手机中运行良好,但是当我尝试将相同的技术应用到我的应用程序中时,可拖动功能无法正常工作。
这是我的代码头,所以你们可以检查我是否插入了正确的 jquery 源。
<head>
<title>Parking Lot App</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="themes/florida_tech.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script src="jquery.ui.touch-punch.min.js"></script> <!-- TOUCH PUNCH -->
</head>
这是显示内容的代码。它只是一个“div”内有 2 个绿色块的图像
<div data-role="content" style="margin:0px; padding:0px; border:0px">
<div id="draggable" class="ui-widget-content" style="position:relative; height: 347px">
<div style=" position: absolute; top: 0px; left: 0px">
<img src="style/pic.png" alt="Parking Lot Map"/>
</div>
<div style="background-color:green; width:17px; height:35px; z-index: 2; position: absolute; top: 31px; left: 81px ">
 
</div>
<div style="background-color:green; width:17px; height:35px; z-index: 2; position: absolute; top: 31px; left: 102px ">
 
</div>
</div>