开发者

Jquerymobile's Tap-hold not working in opera mobile widget emulator

I tried implementing Tap-hold function of jquerymobile as given in one of its demos

<!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=开发者_如何学Python"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>

but swipe is not working at all in opera widget emulator and tap-hold is working very weirdly, it works when u tap twice and then swipe it doesn't work on hold. I tried removing binding to swipe function but there was no change.


Maybe the emulator does not use tap event, but only a click event. When clicked does not emulate tap event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜