2013-10-21 116 views
-3

我只是想知道,如果它能够真正得到溢出滚动到使用jQuery UI拖动协同工作,在手机上。我知道jQuery用户界面无法在移动工作,但我已经得到了黑客它,所以它不仅响应鼠标也触及的脚本。jQuery的可拖动和溢出滚动

现在如果我在一个代码来获得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> 
+0

你有没有_have_是如此的进攻在原来的职位?好东西我编辑它... – Bojangles

+3

请不要在这里使用冒犯性的语言。堆栈溢出是专业人士的网站。 – ChrisF

+0

哦,我真是对不起我只是复制并粘贴随意的事情,我没有意思是坏攻势把它放在 –

回答

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> 

现在它工作正常。

+0

嗨韦达,我不得不之前,但我重新编辑,错过了结束标记。我想我没有把问题弄清楚:我知道拖动工作正常。我想要的是溢出卷轴(div中的内容,这些“你好,先生们欢迎你到最后!!!你想买三明治吗?不用了,我不喜欢草莓”)我应该可以向下滚动它们并最终看到“最后一段”句子 注意:它适用于计算机浏览器,但我希望使其可以在移动设备上工作。它与JQuery UI中的可拖动函数有关 –