TAILIEUCHUNG - Professionali Phone and iPod touch Programming phần 5

Để nhận được hướng dẫn, sử dụng saddr = tham số để chỉ ra địa chỉ bắt đầu và daddr tham số để xác định địa chỉ đích, như trong ví dụ sau: Bạn có thể chỉ định một vị trí bằng cách sử dụng tọa độ vĩ độ và kinh độ: | Chapter 5 Handling Touch Interactions and Events continued meta name viewport content width 320 initial-scale maximum-scale user-scalable 0 script type application x-javascript function orientationChange var str Orientation switch case 0 str Portrait break case -90 str Landscape right screen turned clockwise break case 90 str Landscape left screen turned counterclockwise break case 180 str Portrait upside-down portrait break mode .innerHTML str script head body onload orientationChange onorientationchange orientationChange h4 id mode Ras sed nibh. h4 p Donec semper lorem ac dolor ornare interdum. Praesent condimentum. Suspendisse lacinia interdum augue. Nunc venenatis ipsum sed ligula. Aenean vitae lacus. Sed sit amet neque. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Duis laoreet lorem quis nulla. Curabitur enim erat gravida ac posuere sed nonummy in tortor. Donec id orci id lectus convallis egestas. Duis ut dui. Aliquam dignissim dictum metus. p body html An onorientationchange attribute is added to the body element and assigned the JavaScript function orientationChange . The orientationChange function evaluates the property to determine the current state 0 Portrait -90 Landscape clockwise 90 Landscape counterclockwise or 18 0 Portrait upside down . The current state string is then output to the document. However note that the onorientationchange event is not triggered when the document loads. Therefore in order to evaluate the document orientation at this time assign the orientationChange function to the onload event. While the onorientationchange event works great for iPhone and later earlier versions of Mobile Safari did not support this event. Therefore if you are designing an application that works on all versions of Mobile Safari you need to perform a workaround to emulate this functionality. 104 Chapter 5 Handling Touch Interactions and .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.