-3

我只是想知道是否有可能真正让溢出滚动与可在手机上拖动的 Jquery UI 一起工作。我知道 Jquery UI 不能在移动设备上运行,但我有一个脚本可以破解它,所以它不仅对鼠标有反应,而且对触摸也有反应。

现在,如果我放入代码以使 Jquery UI 可拖动工作,那么溢出滚动将不会如此,是的,我只是想知道是否有人知道如何解决这个问题?

这是我的代码

 <!DOCTYPE HTML>
<html >
<head>
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no, width=100%" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script src="http://webprofolio.freeserver.me/jquery.ui.touch-punch.min.js"></script>
<style>

#parent
{
    background-color:blue;
    width:400px;
    height:400px;
}

#content
{
    background-color:red;
    width:380px;
    height:380px;
    overflow-y:auto;
    margin:auto;
}

#thebody
{
    background-color:green;
    width:600px;
    height:400px;
}  

</style>

</head>
<body>

<div id="thebody">
<div id="parent">
<div id="content">
<p>
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
Hello gentlemen welcome to the end of the days!!! you want to buy some sandwiches? No thanks, I don't like strawberries
The last paragraph
</p>
</div>
</div>
</div>

<script>

touchMove();

function touchMove()
{
    $( "#parent" ).draggable({ axis: "x" , containment:"parent"},
    {});

}



</script>


</body>
</html>
4

1 回答 1

0

您缺少结束标签“>”

<script src="http://webprofolio.freeserver.me/jquery.ui.touch-punch.min.js"</script>

<script src="http://webprofolio.freeserver.me/jquery.ui.touch-punch.min.js"></script>

现在它工作正常。

于 2013-10-21T12:34:31.770 回答