Skip to Content
MOBILE WEB程式設計--第二版
book

MOBILE WEB程式設計--第二版

by Maximiliano Firtman
December 2013
Intermediate to advanced
752 pages
16h
Chinese
GoTop Information, Inc.
Content preview from MOBILE WEB程式設計--第二版
設備互動
|
561
若要在偵測手勢的元素中套用 CSS 變形,我們可以使用下列來自 Microsoft 官方文件範
例的程式片段:
myElement.addEventListener("MSGestureChange", function(e) {
// 取得元素中最新的 CSS 變形
var m = new MSCSSMatrix(e.target.style.transform);
e.target.style.transform = m
// 在手勢的中心點下方移動變形原點
.translate(e.offsetX, e.offsetY)
.rotate(e.rotation * 180 / Math.PI) // 套用旋轉
.scale(e.scale) // 套用縮放
.translate(e.translationX, e.translationY) // 套用變形
.translate(-e.offsetX, -e.offsetY); // 移回變形原點
}, false);
感應器
觸碰並非唯一可讓 HTML5 行動 App 讀取的輸入方式。在 iPhone 出現之後問世的設
備,大都具備許多感應器,我們也可以用它們來為 App 與遊戲提供輸入資料,其中包括
加速度計、磁強計(數位羅盤),與陀螺儀。有一些設備也具備壓力與光感應器。
這些感應器的原理已超出本書的範圍,我們的重點在於瞭解每一種感應器的用途:
加速度計
以三個軸(
x
y
z
)來測量設備的線性移動(當下的加速度),包括重力。也就是 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9789862769522