TAILIEUCHUNG - Wordpress 3.0 jQuery - part 14

Tham khảo tài liệu 'wordpress jquery - part 14', 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ả | Digging Deeper Understanding jQuery and WordPress Together Note that each function and method you wrap your plugin in and use inside your plugin must end in a semicolon. Your code may otherwise break and if you ever compress it it will definitely break. That s it all that s required of a jQuery plugin. Now let s dive in to enhancing the output of our WordPress plugin with a jQuery plugin. Project jQuery fade in a child div plugin Taking the required jQuery function discussed previously I m going to write up a basic function which can be passed not only to the main jQuery wrapper selection but an additional selector parameter so that it s easy to target the child div of a selection or the specific parameter of the jQuery selection that s passed the parameter. Again note the bold comments in my authorHover function to follow along . sets up the new plugin function authorHover function applyTo makes sure each item in the wrapper is run return function if else to determine if parameter has been passed no param just looks for the child div if applyTo obj applyTo else obj div hides the child div or passed selector jQuery this .find obj .hide sets the main wrapper selection with a hover jQuery this .css cursor pointer .hover function restyles the child div or passed selector and fades it in jQuery this .find obj .css position absolute .css margin-top -10px .css margin-left -10px .css width 400px .css border 1px solid 666 .fadeIn slow function 116 Chapter 3 fades out the child selector jQuery this .find obj .fadeOut slow That s all it takes. Now that we ve created a jQuery plugin script let s quickly test it out in our theme first. All we have to do is embed our new jQuery plugin named to our theme under the wp_enque_script call below the wp_head hook and evoke it with a simple script . script type text javascript jQuery function jQuery .authorName .authorHover script We can take a look at the results in our site. I ve .

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.