TAILIEUCHUNG - Practical prototype and scipt.aculo.us part 50

Practical prototype and part 50: The information in this book is distributed on an "as is" basis, without warranty Although every pre-caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. | CHAPTER 12 ADVANCED CONTROLS AUTOCOMPLETERS IN-PLACE EDITORS AND SLIDERS 291 Figure 12-7. The in-place editor s edit mode Making It Pretty Astute readers will have already noticed that an hl element looks much different from a text box with the same text content. We can fix that quite easily with CSS. Click the in-place editor to put it into edit mode once again then use Firebug to inspect the text box that appears. With the Firebug pane visible click Inspect and then click in the text box. The HTML inspector shows us that the input element has a class name of editor_field and that its form parent node has an ID of team_name-inplaceeditor in other words it adds -inplaceeditor to the ID of the original element. Armed with this information we can write a CSS selector that targets both read mode and edit mode. Add this to the style element in your document s head h1 team_name form team_name-inplaceeditor .editor_field font-size 19px font-weight bold 292 CHAPTER 12 ADVANCED CONTROLS AUTOCOMPLETERS IN-PLACE EDITORS AND SLIDERS Now the element looks the same in either mode as shown in Figure 12-8. Maintaining the text s styling helps the user navigate a new and perhaps unfamiliar UI pattern. Figure 12-8. The read mode on the left and the edit mode on the right are now far less disjointed-looking resulting in a friendlier user interface. Common Options and Features is like its brethren endlessly configurable. Here are some of the most useful options okButton and okText control the display of the button that submits the value to the server. Setting okButton to false hides the button altogether the form can only be submitted via the Enter key. The okText parameter which defaults to ok lets you change the label of the button . Save Go or Make it Happen . cancelLink and cancelText control the display of the link that cancels the edit operation. Setting cancelLink to false hides the link. The cancelText parameter lets you change the label

TỪ KHÓA LIÊN QUAN
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.