zoukankan      html  css  js  c++  java
  • HTML5移动开发笔记

    HTML5移动开发笔记


    ev.pageX 相对页面横向偏移
    ev.pageY 相对页面纵向偏移


    ev.pageX = ev.clientX + window.scrollLeft();
    ev.pageY = ev.clientY + window.scrollTop();

    -------------------------------------------------------------------------------------------------------------------

    设备信息初始设置

    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">

    device-width 设备宽度
    initial-scale:1.0 初始缩放比例1.0
    maximum-scale:1.0 允许用户缩放的最大比例1.0
    minimum-scale:1.0 允许用户缩放的最小比例1.0
    user-scalable:0 是否允许用户缩放

    -------------------------------------------------------------------------------------------------------------------

    @media 媒体查询

    屏幕逻辑宽度在320px至640px之间
    <link href="css/css_320_640.css" type="text/css" rel="stylesheet" media="(min-320px) and (max-640px)"
    />

    -------------------------------------------------------------------------------------------------------------------

    单点触摸touch事件

    touchstart() 触摸开始
    touchmove() 触摸移动
    touchend() 触摸结束

    -------------------------------------------------------------------------------------------------------------------

    多点触摸touch事件

    ev.touches数组 存储所有手指信息
    ev.changedTouches数组 存储所有抬起的手指数组

    ev.touches数组及ev.changedTouches数组中对象均包含identifier属性,即触摸点ID,例如:ev.touches[ev.touches.length-
    1].identifier,即为最后按下的手指触摸点ID。

  • 相关阅读:
    缓动函数速查表
    PHP递归题目
    linux下crontab定时执行本地脚本和定时访问指定url
    jsonp跨域js
    采用PHP函数uniqid生成一个唯一的ID
    php会话(session)生命周期概念介绍及设置更改和回收
    thinkphp3.2 学习
    PDO 查询mysql返回字段整型变为String型解决方法
    apache性能优化
    汉诺塔(四)(暴力)
  • 原文地址:https://www.cnblogs.com/baie/p/2757006.html
Copyright © 2011-2022 走看看