TAILIEUCHUNG - HTML cơ bản - p 26

234 Chapter 5: Building Websites example : using jQuery to toggle a hidden menu Example #state-choice { position: relative; /* to contain the drop element */ } #state-choice h4:hover { cursor: pointer; /* change the pointer on mouseover */ } #states { display: none; /* initial state is hidden */ position: absolute; top: ; /* move the links below the heading */ padding: .5em; background-color: white; /* need to cover of other content */ border: thin solid; } #states a { display: block; /* we don't get any breaks around here */ padding-top: .25em; font-size: small; }. | 234 Chapter 5 Building Websites Example Using jQuery to toggle a hidden menu DOCTYPE html html head title Example title script src http script style type text css state-choice position relative to contain the drop element state-choice h4 hover cursor pointer change the pointer on mouseover states display none initial state is hidden position absolute top move the links below the heading padding .5em background-color white need to cover of other content border thin solid states a display block we don t get any breaks around here padding-top .25em font-size small style head body div id state-choice h4 onclick states .toggle slow Choose your state h4 div id states a href Excited a a href Confused a a href Disappoi nted a a href Angry a div From the Library of Wow eBook Organization and Navigation 235 p To help us serve you better. p div body html Figure shows how this code appears in a browser before and after the level-four heading is clicked. The key to making it work is in the jQuery expression assigned to the onclick attribute of the h4 element states .toggle slow The dollar sign beginning the expression is an alias for the jQuery function. The expression instructs the browser to select the element with the i d attribute of states. The browser applies a toggle to the element so that if it is currently hidden it is displayed and if it is visible it disappears when the heading is clicked again. The toggle method takes an optional speed parameter. The strings fast and slow can be used as well as a number indicating the effect s duration in milliseconds. Example A Example Choose your state Choose your stpte To help us serve you better. - Excited . conned erve you better. Disappointed Angry Figure A jQuery drop menu IMAGEMAPS Every once in a while the best way to solve a particular navigation problem is graphically. That s why the imagemap exists. If the .

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.