首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Windows Phone 7 Mango IE中的触摸事件

Windows Phone 7 Mango IE中的触摸事件
EN

Stack Overflow用户
提问于 2011-08-22 11:56:05
回答 3查看 6.2K关注 0票数 6

WP7芒果中的IE会支持像iOS或Android那样的触控事件吗?触摸事件似乎将成为W3C的标准:http://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html。IE9说它遵循标准,有谁知道它是否会支持触摸事件?谢谢。

EN

回答 3

Stack Overflow用户

发布于 2012-08-07 01:05:44

它目前不支持触摸事件。你所需要做的就是证明它是这样简单的东西:

代码语言:javascript
复制
document.ontouchstart = function() { alert("TS"); }
document.ontouchmove = function() { alert("TM"); }
document.ontouchend = function() { alert("TE"); }

所有这些都不能在IE9手机上运行。

票数 5
EN

Stack Overflow用户

发布于 2011-08-23 00:23:40

它目前不支持触摸事件。

票数 1
EN

Stack Overflow用户

发布于 2011-10-26 23:22:20

这在一定程度上是不正确的。我是在Windows phone7上开发的,并且实现了触控效果。

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

在这里,这适用于HTC HD7 -移动版本和桌面版本选择。您可以看到以下代码:

代码语言:javascript
复制
<!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>
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7143008

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档