簡體   English   中英

觸摸Windows Phone 7 Mango IE中的事件

[英]Touch Events in Windows Phone 7 Mango IE

WP7 Mango中的IE會支持iOS或Android等Touch事件嗎? 觸摸事件似乎將成為W3C的標准: http//dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html IE 9表示它遵循標准,有誰知道它是否會支持觸摸事件? 謝謝。

它目前不支持觸摸事件。 所有你需要做的就是證明它是這樣的簡單:

document.ontouchstart = function() { alert("TS"); }
document.ontouchmove = function() { alert("TM"); }
document.ontouchend = function() { alert("TE"); }

這些都不會在IE9手機中觸發。

它目前不支持觸摸事件。

這部分不正確。 我在Windows Phone 7上開發。我已經實現了觸摸效果。

http://jsfiddle.net/blackdynamo/yxhzU/

在這里,這適用於HTC HD7 - 移動版和桌面版選擇。 你可以看到下面的代碼:

<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>jQuery Mobile Carousel Demo - jsFiddle demo by blackdynamo</title>
  <script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js' jquery.mobile, carousel></script>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"></script>
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  <script type='text/javascript' src="https://github.com/blackdynamo/jQuery-Mobile-Carousel/raw/master/jquery.ui.ipad.js"></script>
  <script type='text/javascript' src="https://github.com/blackdynamo/jQuery-Mobile-Carousel/raw/master/jquery.mobile.carousel.js"></script>
  <style type='text/css'></style>
  <script type='text/javascript'>
  //<![CDATA[ 
  $(window).load(function(){
      (function($) {
        $("#carousel1").carousel();
        $("#carousel2").carousel({direction: "vertical"});
    })(jQuery);
  });
  //]]> 
  </script>
  </head>
  <body>
Horizontal
<div style="height: 300px; width: 500px">
    <ul id="carousel1" style="display: none;">
    <li>
        <div style="width: 100%; height: 100%; background-color:#381;">Page 1</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#837;">Page 2</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#999;">Page 3</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#738;">Page 4</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#142;">Page 5</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#927;">Page 6</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#987;">Page 7</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#187;">Page 8</div>
      </li>
  </ul>
  </div>
Vertical
<div style="height: 300px; width: 500px">
    <ul id="carousel2" style="display: none;">
    <li>
        <div style="width: 100%; height: 100%; background-color:#381;">Page 1</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#837;">Page 2</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#999;">Page 3</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#738;">Page 4</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#142;">Page 5</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#927;">Page 6</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#987;">Page 7</div>
      </li>
    <li>
        <div style="width: 100%; height: 100%; background-color:#187;">Page 8</div>
      </li>
  </ul>
  </div>
</body>
</html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM