WordPress jquery processing Sofa Head _jquery

Source: Internet
Author: User
I think it's not fair to the couch students. Yesterday in the Yinheli classmate's "Mouse Suspension display message content" A text (suggestion to see, Good article), think of me why not the head of the sofa to copy out and put in a conspicuous position, the following screenshot effect.

The first step is to have your site loaded with jquery and then add a <div> where you need to place the head of the couch, and the content is empty:
Copy Code code as follows:

<div id= "Shafa" ></div>

Then to do is to use JS copy the sofa head, and the copied content into the above set <div>:
Copy Code code as follows:

$ (document). Ready (function () {
$ (". Commentlist. Avatar:last img"). Clone (). Appendto ("#shafa");
});

That's it.
Avatar
Let's say you have a style name for your theme template that contains the avatar picture;
: Last
This is for the same as me in the reverse message board set, because the sofa is the classmate at the end of the message list, and for the order of the message board, then change to
: A

Also, don't forget to make CSS style definitions. You can use the same method to copy the specified content, such as the sofa message content, name, etc., as long as the corresponding to their style name.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.