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

1

13

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="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.

Kornegay answered 5/3, 2011 at 11:45 Comment(4)
What opera product and version are you talking about?Apteral
I was testing it on opera mobile widget emulator which comes with operamobile 10.1 beta (widget emulator only comes with this version I think)and here is the link of above mentioned emulator opera.com/developer/toolsKornegay
I know it's weird, but try cerating a div with an id and bind events to that. If it doesn't help, then it's a compatibility issue. BTW JQMalpha4 is out. Try it. you are using alpha1 which is REALLY oldApteral
No couldn't find anything....Kornegay
F
1

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

Fleuron answered 7/11, 2011 at 9:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.