HTML in 10 Steps or Less- P14

HTML in 10 Steps or Less- P14:Welcome to HTML in 10 Simple Steps or Less. Our mission in writing this book is to provide a quick and accessible way for you to learn Hypertext Markup Language — the lingua franca of the World Wide Web. We hope this book provides a resource that beginning and intermediate HTML coders can use to improve their Web development skills. It is also our hope that it fills multiple roles as both a teaching tool and a reference once you expand your skills. | 236 Part 10 Task 09 Creating Simple Pop-up Windows note You need the hyperlink to create an element that the mouse interacts with. Instead of opening a document you can enter a little JavaScript that creates a new window object. Before you read onward you should understand why pop-up blocking software is so popular. When used intrusively pop-up windows aggravate your visitors experience of your Web site. Use them if at all to enhance the viewing experience not to pummel viewers into submission. In this task you learn how to open a small window with a mouse click. 1. Within the body of your document insert an anchor tag a 2. Define an href attribute for the tag and set it equal to a href 3. Follow the attribute with an onClick event handler as shown here a href onClick 4. Set the event handler equal to as shown here a href onClick 5. Inside the parentheses enter the name of the document inside single quotes that you want displayed in the pop-up window. For example a href onClick 6. Enter a comma and follow the name of the document with the name you want to assign the window object. For example a href onClick myWindow 7. Enter a comma and define the window properties you want to include within single quotes separated by commas. For example a href onClick myWindow width 300 height 200 Please purchase PDF Split-Merge on to remove this watermark. Simple JavaScript Your choices are as follows width specifies the width of the window in pixels height specifies the height of the window in pixels location yes includes the window s address bar toolbar yes includes the window s standard toolbar buttons scrollbars yes includes the window s scrollbars 8. Follow the opening anchor tag with the image or text you want affected and complete the link with a closing anchor tag. Listing 109-1 shows such a link in a document. Figure 109-1 shows the results in a browser. 237 Task

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
97    83    2    14-05-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.