Báo cáo tài liệu vi phạm
Giới thiệu
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
THỊ TRƯỜNG NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
Thông tin
Tài liệu Xanh là gì
Điều khoản sử dụng
Chính sách bảo mật
0
Trang chủ
Công Nghệ Thông Tin
Đồ họa - Thiết kế - Flash
JQuery: Novice to Ninja- P17
Đang chuẩn bị liên kết để tải về tài liệu:
JQuery: Novice to Ninja- P17
Nam Hưng
52
15
pdf
Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG
Tải xuống
JQuery: Novice to Ninja- P17:No matter what kind of ninja you are—a cooking ninja, a corporate lawyer ninja, or an actual ninja ninja—virtuosity lies in first mastering the basic tools of the trade. Once conquered, it’s then up to the full-fledged ninja to apply that knowledge in creative and inventive ways. | Construction Ajax and Interactivity 217 chapter_06 11_endless_scrolling script.js excerpt checkscroll function var gallery_div this.container if gallery_div 0 .scrollHeight - gallery_div.height - gallery_div.scrollTop 0 this.load Our checkscroll function looks a bit complex at first but there s really little to it. We re going to be messing around with the gallery s containing object quite a bit in this function so we store a reference to it to avoid running the same selector over and over. This would lead to a significant performance hit especially as jQuery will generate lots of events whenever the user scrolls the scroll bar. Next we do some math to determine whether the scroll bar has hit the bottom yet. For this we ll need to break out of jQuery for a bit and deal with some plain old JavaScript. The scrollHeight property is a nonstandard JavaScript property that s nonetheless supported by all major browsers. It tells us the total scrollable height of an element unlike height which only tells us how much vertical space the element occupies on the page. In order to access it we need to pull the raw DOM node from the jQuery object the shortcut for this is 0 . By subtracting the element s height and the current scrolling position from this scrollHeight property we ll determine how far from the bottom of the element the user is scrolled to. If this equals 0 the scroll bar is resting at the bottom and we can load the images. But what happens if the user starts scrolling up and down like a crazy person Will we start firing off requests willy-nilly We sure will And as the requests start returning our code will start adding in images lots of them That may be a little inappropriate for our gallery control so as a final touch let s build in a small safeguard. We ll add a Boolean property to our GALLERY object called running. When we re about to load some data we ll first check that the running variable is set to true. If it is this means an Ajax call is currently .
TÀI LIỆU LIÊN QUAN
jQuery: Novice to Ninja
JQuery: Novice to Ninja by Earle Castledine and Craig Sharkie
jQuery: Novice to Ninja full
JQuery: Novice to Ninja- P1
JQuery: Novice to Ninja- P2
JQuery: Novice to Ninja- P3
JQuery: Novice to Ninja- P4
JQuery: Novice to Ninja- P5
JQuery: Novice to Ninja- P6
JQuery: Novice to Ninja- P7
Đã 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.