這是在MouseOver上滑動另一個div而返回MouseOut。現在,當我觸摸maindiv時,在ipad上滑動了lowerdiv,但我無法弄清楚它是否會讓它滑回來再次顯示maindiv。我也試過jquery.ui.touch-punch.min.js,但沒有反應。我希望它滑回onclick或觸摸,如果沒有在設置時間後觸摸X.有人可以幫忙嗎?在另一個iPad上滑動一個div
<script language="JavaScript" type="text/javascript">
<!--
$(function(){
$(".maindiv").hover(function(){
$(this).children('.lowerdiv').stop().animate({top:0})
},function() {
$(this).children('.lowerdiv').stop().animate({top:140})
})
})
//-->
</script>
<style>
.maindiv{
height:66px;
width:390px;
background:#FFF;
position:relative;
overflow:hidden;
float:left;
margin:0px;
}
.lowerdiv{
height:66px;
width:390px;
background:#FFF;
position:absolute;
top:140px;
}
</style>
<div class="maindiv">
//Main div content
<div class="lowerdiv">
//2. div content
</div>
</div>
這可以幫助你:http://phonegap-tips.com/articles/fast-touch-event-handling-eliminate-click-delay.html – maverickosama92