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

Trừ khi bạn đang tạo một ứng dụng iPhone hay iPod touch, phát triển cho Tier 2 hoặc hỗ trợ 3 sẽ cung cấp hỗ trợ đầy đủ cho hầu hết các trang web. Tuy nhiên, bạn có thể tìm thấy một nhu cầu thực sự hấp dẫn để phát triển một trang web cụ thể bằng văn bản cho iPhone / iPod touch. Các nội dung có thể là cùng, nhưng nó cần được cấu trúc một cách thảo luận ở Chương 2 và 3. | Chapter 8 Enabling and Optimizing Web Sites for iPhone and iPod touch Tier 4 Parallel Sites Unless you are creating an iPhone or iPod touch application developing for Tier 2 or 3 support will provide sufficient support for most sites. However you might find a compelling need to actually develop a site specifically written for iPhone iPod touch. The content may be the same but it needs to be structured in a manner discussed in Chapters 2 and 3. Avoid Handcuffs Offer Freedom If you are going to offer an iPhone iPod touch version of your site you want to offer your users the freedom to choose between the customized site and your normal site. Don t auto-redirect based on user agent. Because Mobile Safari can navigate a normal Web site you should always allow users to make the decision themselves. provides a good model. As Figure 8-16 shows when you access their homepage on your iPhone it clearly notifies you of the alternative site but does not handcuff you into using it. 197 Chapter 8 Enabling and Optimizing Web Sites for iPhone and iPod touch Figure 8-16 Amazon offers freedom to use the normal site or an iPhone-specific version. To add a similar functionality to a Web site begin by adding an empty div element at the top of your content just below the top menu div id iphone-ipod-notify div This element will serve as the placeholder for the message that you will display to iPhone and iPod touch users. Next add the following script script type application x-javascript function isAppleMobile result iPhone -1 iPod -1 function init 198 Chapter 8 Enabling and Optimizing Web Sites for iPhone and iPod touch if isAppleMobile var o iphone-ipod-notify h1 style text-align center -border 1px solid a23e14 -webkit-border-radius 10px a href Tap here to go to our br iPhone iPod touch web site. a h1 script The init function calls isAppleMobile function to .

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.