TAILIEUCHUNG - Lập trình iphone chuyên nghiệp part 5

Scripting UI Behavior with Khi bạn sử dụng khuôn khổ IUI, quyền hạn tất cả các hành vi giao diện cho bạn một khi bạn cho nó vào đầu tài liệu của bạn | Chapter 3 Implementing the Interface Scripting UI Behavior with When you use the iUI framework powers all of the UI behavior for you once you include it in your document head. However because the iUI framework does take control over many aspects of the environment it is important that you have a solid understanding of the library s internals. The consists of a JSON object three listeners for load and click events and several supporting routines. All of the JavaScript code is enclosed in an anonymous function with several constants and variables defined function var slideSpeed 20 var slideinterval 0 var currentPage null var currentDialog null var currentwidth 0 var currentHash var hashPrefix _ var pageHistory var newPageCount 0 var checkTimer rest OF IUI CODE HERE The anonymous function creates a local scope to allow private semi-global variables and avoid name conflicts with applications that use . On Document Load When the HTML document loads the following listener function is triggered addEventListener load function event var page if page page setTimeout preloadImages 0 setTimeout checkOrientAndLocation 0 checkTimer setinterval checkOrientAndLocation 300 false The getSelectedPage method of the JSON object iui is called to get the selected page the block element node that contains a selected true attribute. This node is then passed to which is the core routine to display content. As Chapter 5 explains setTimeout is often used when calling certain JavaScript routines to prevent timing inconsistencies. Using setTimeout iUI calls an image preloader function to load application 68 Chapter 3 Implementing the Interface images and then a routine called checkOrientAndLocation which is an event handler used for detecting and handling viewport orientation changes. Orientation change events are fully covered in Chapter 5. The setinterval function then calls .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.