Tự học HTML và CSS trong 1 giờ - part 56

Tham khảo tài liệu 'tự học html và css trong 1 giờ - part 56', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 526 LESSON 17 Working with Frames and Linked Windows script In this case when the page loads I retrieve the link by its ID and then bind a new anonymous function to it that calls the original popup function. Instead of hard coding the URL I pass to the popup function so that it opens the URL in the link. Using a library like jQuery can make things even easier. Suppose you want any link tag with the class popup to open a new window with the URL associated with the link. Here s the code script type text javascript document .ready function .click function event var mywindow newwindow1 height 200 width 400 script When the page is ready I apply the same onclick handler to all the links on the page with the class popup. The anonymous event handler opens a new window with the URL stored in which returns the URL in the link that the user clicked on. It then calls the preventDefault method on the link which is a sort of fancy way to return false provided by jQuery. It s used instead of just returning false because it doesn t disrupt other event handlers that may be fired in addition to this one. Summary If your head is hurting after this lesson you re probably not alone. Although the basic concepts behind the use of frames are relatively straightforward their implementation is somewhat harder to come to grips with. As a result the best way to learn about frames is by experimenting with them. In this lesson you learned how to link a document to a new or existing window. In addition you learned how to create framesets and link them together by using the tags listed in Table . Download from Summary 527 The Downside of Frames In this lesson I mentioned a few drawbacks of frames here and there. I want to talk about them one more time now that the discussion of frames is coming to a close. The problem with frames is that they change the concept of a web page. Unfortunately many mechanisms

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
61    75    1    03-06-2024
Đã 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.