Skip to Content
MOBILE HTML5學習手冊
book

MOBILE HTML5學習手冊

by Estelle Weyl
June 2014
Intermediate to advanced
488 pages
9h 56m
Chinese
GoTop Information, Inc.
Content preview from MOBILE HTML5學習手冊
行動效能
|
423
此外,因為行動設備是觸控設備,而且“雙按”是使用者動作之一,行動設備會在回應
觸碰之前,先等待一段時間來判斷是否為雙按。在大部分的觸控設備上,都有預設 300
ms 500 ms
touchend
事件等待時間,之後才會採取動作。因此,或許你可以加入
touchend
事件的監聽器來指派點按等預設事件,讓你的應用程式更具回應性。
在增加觸控(touch)事件時,不要移除點擊(click)事件:我們希望無
論使用者與網站的互動方式為何,都可以讓網站動作(無論用他們的手
指、滑鼠或其他方式)。
為了等待雙按而加入的延遲不一定適合所有情況
9
。在 Chrome Firefox 中,如果停用
縮放功能就不會有延遲。只為了避免這種延遲,而使用中繼標籤來停用縮放功能,會讓
它成為不好的使用者體驗:不要停用縮放,除非你有非常好的理由,例如在互動式的遊
戲中。
動畫
因為 Web 是單執行緒的,而且在執行緒中,JavaScript 的優先權高於 CSS 動畫,如果動
畫不是非常重要的話,請務必使用 CSS 來取代 JavaScript
因為 CSS 動畫有較低的優先權,在網頁被載入之前不會開始動畫,因為 UI 執行緒正忙
著解析指令碼與算繪。雖然動畫不會開始,但 animation-delay 計時器不會等待網頁載入
才開始。如果你有許多延遲時間不一樣的動畫,會發現有一些動畫會在網頁載入之後同
時開始,因為動畫延遲時間比網頁載入時間短的元素都會在同樣的時間開始。
如前所述,在大部分的設備上,最順暢的動畫是每秒播放 ...
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

JAVASCRIPT網頁應用程式設計

JAVASCRIPT網頁應用程式設計

Alex MacCaw

Publisher Resources

ISBN: 9789863471240