Jquerymobile的Tap-hold在Opera移动小部件模拟器中不起作用

时间:2011-03-05 11:45:20

标签: iphone android widget opera jquery-mobile

我尝试在其中一个演示

中实现jquerymobile的Tap-hold功能
<!DOCTYPE html> 
<html> 
<head> 
<title>jQuery Mobile Events</title> 
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" />
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>
<script type="text/javascript">

$( function() {

  $('body').bind( 'taphold', function( e ) {
    alert( 'You tapped and held!' );
    e.stopImmediatePropagation();
    return false;
  } );  

  $('body').bind( 'swipe', function( e ) {
    alert( 'You swiped!' );
    e.stopImmediatePropagation();
    return false;
  } );  

} );

</script>  

</head>

<body> 

<div data-role="page" id="home">

  <div data-role="header">
    <h1>jQuery Mobile Events</h1>
  </div>

  <div data-role="content"> 
    <p>Try:</p>
    <ul>
      <li>Tapping and holding</li>
      <li>Swiping</li>
    </ul>
  </div>

</div>

</body>
</html>

但是在opera小部件模拟器中滑动根本不起作用并且轻击保持工作非常奇怪,当你点击两次然后滑动它无法保持工作时它可以正常工作。我尝试删除绑定到滑动功能,但没有变化。

1 个答案:

答案 0 :(得分:1)

也许模拟器不使用点击事件,而只是点击事件。 点击时不会模拟点击事件。