Current location: home page > course >Body

Zblog Information Flow Advertisement Plug in Element Selector Tutorial

The jQuery element selector and attribute selector allow you to select HTML elements by tag name, attribute name, or content.

What you need to understand is how the selector accurately selects the elements you want to apply the effect to.

ZBLOG The function of the information flow advertisement plug-in is to randomly insert an advertisement into the article list.

Then, we need to accurately locate the list of articles

Take my simple single column Pro theme as an example

Right click the first article in the list and select Check

 Zblog Information Flow Advertisement Plug in Element Selector Tutorial Page 1

You can see the source code in devtools

We will find a lot of similar code duplication

The common point of codes is that they all contain a li tag

So we can use the li tag to locate the list elements

 Zblog Information Flow Advertising Plug in Element Selector Tutorial Page 2

This is when the problem comes

This tag is not only available in the list area of the entire page, but also in other places.

Continue to search and find class="list"

So we can use. list li to select the articles in the article list

In the above example, we found that each li tag has many identical css classes

So we can also use. list+the same css class as a selector.

Selectors for some of my topics

Zhiboku (general list), Xiaoxiaoshu, Xiaoqingxin, Qingtong Community, News We Media, game recommendation:. post_list_li

Light photo:. lpost

Unbounded, large R:. r_box ul li

Single column simplicity Pro:. list li

Universal theme:. article. post


Resource download

Zblog information flow advertisement plug-in

Updated on: 2022-06-22