13
我試圖實現jquerymobile的點擊保持功能在其演示Jquerymobile的Tap-持有歌劇移動小工具仿真器不工作
<!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>
的一個給定的,但刷卡時不工作在歌劇工具仿真器和水龍頭 - 保持工作非常古怪,當你點擊兩次,然後滑動它不起作用。我嘗試刪除綁定到滑動功能,但沒有改變。
你在說什麼歌劇產品和版本? – naugtur 2011-03-07 11:08:19
我在operamobile 10.1 beta附帶的opera opera widget模擬器上測試它(小部件模擬器只帶有這個版本,我認爲),這裏是上述模擬器的鏈接http://www.opera.com/developer/tools/ – Junaid 2011-04-03 12:01:24
我知道這很奇怪,但嘗試使用id來封閉div並將事件綁定到該div。如果它沒有幫助,那麼這是一個兼容性問題。順便說一句JQMalpha4出來了。嘗試一下。你正在使用alpha1,這是真的老 – naugtur 2011-04-04 13:17:32