TAILIEUCHUNG - JavaScript FOR ™ DUMmIES phần 7

để trao đổi hình ảnh được đặt tên mkt_pic từ phiên bản màu trắng lên phiên bản màu tímBạn có thể tìm thấy một phiên bản làm việc của mã này chịu trách nhiệm hình và trong đó bao gồm các chức năng trao đổi () cũng như các mã sau trên | Chapter 11 Creating Pop-Up Help Tooltips 209 Putting it all together Using DHTML code to create simple tooltips Sometimes you find it useful to experiment with a working script containing all the necessary elements for DHTML tooltips HTML code that defines the active areas for which you want to create tooltips style sheet code that defines how you want your tooltips to appear and JavaScript code that tells the Web browser to display or hide the appropriate tooltips depending on mouse pointer position. In Listing 11-5 a complete working script is exactly what you find. Listing 11-5 pulls together the code you see in Listings 11-1 through 11-4 to demonstrate how each piece fits together. You can find the code in Listing 11-5 on the companion CD under the filename . Listing 11-5 The Whole Enchilada A Working Tooltip Script HTML HEAD TITLE Tooltip Example from JavaScript For Dummies 4th Edition TITLE SCRIPT type text javascript language Javascript -- Hide script from older browsers if latestBrowser true else latestBrowser false function displayTip theEvent currentElement if latestBrowser tooltip currentElement .style else tooltip eval document. currentElement if parseInt 2 2 parseInt -75 else if latestBrowser parseInt 2 px continued 210 Part III Making Your Site Easy for Visitors to Navigate and Use Listing 11-5 continued 2 parseInt -75 px else parseInt 2 2 parseInt -75 visible function hideTip currentElement if latestBrowser tooltip currentElement .style else tooltip eval document. currentElement hidden End hiding script -- SCRIPT STYLE type text css -- .tooltipStyle background-color pink border pink 1px solid layer-background-color pink width .

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.