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

Practical prototype and part 47: 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. | 272 CHAPTER 11 ENABLING DRAGGABLES DROPPABLES AND SORTABLES script type text javascript dom loaded function container script head body ul id container li class foo id item_1 Lorem li li class foo id item_2 Ipsum li li class foo id item_3 Dolor li li class foo id item_4 Sit li li class foo id item_5 Amet li ul body html Aside from the script element the only change we ve made is to remove the drop zone container which we don t need anymore. Reload this page and you ll find that the container is already behaving like a sortable. The list items inside it can be dragged and reordered when a dragged element gets near a new slot the elements on either side part to give it room. When dropped the element stays in its new place. Sortable Options We were able to use so effortlessly because our markup conformed to many of its default options. The more specialized the usage however the more configuration will be needed. The following subsections describe some of the other options you might use with sortables. The tag Option looks for children of a certain tag name to declare as draggables. This option tag is a string that refers to that tag name. It defaults to li the semantic child of unordered and ordered lists ul and ol . If your draggables are not going to be list items you must specify the tag name. CHAPTER 11 ENABLING DRAGGABLES DROPPABLES AND SORTABLES 273 The only Option The only option is a string that if set represents a CSS class that all children must have in order to be treated like draggables. This is a way to further winnow down the set of draggables for instance if only certain children are eligible for reordering. The overlap Option The overlap option expects a string either vertical or horizontal. Vertical sortables are the default horizontal sortables can be created with a smack of CSS trickery and a grasp of element floating rules. The containment Option The containment option is tricky it .

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.