2013-10-21 164 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中的可拖動函數有關 –