3
4When browsing a website, some websites always place advertisements in the lower right corner, upper left corner or other places.
I tried to make one myself using jQuery. The code is as follows. If there is something wrong, please let me know.
1 2 3 4 56 7 21 22 23 24 25
The rendering is as follows
Regarding this effect, I have the following thoughts:
1. You can add a timer to count down '5S to close' and '4S' Close' tells the user that this advertisement is only temporarily placed and will be automatically closed after 5 seconds. This can enhance the user experience. We all know that when browsing some websites, advertisements always take up space and hang in front of your eyes. The user experience is definitely not very good. , which can create a good balance between advertisers and user experience;
2. The reason why the background color is orange is because orange is a warm color. Personal experience, if the advertising background is a warm color , I am more willing to let him stay for some time, compared to ads with cold background colors;
3. Of course, this is just a small code. After the masters complete the content, they can encapsulate it, and it will definitely be more convenient to use. .
The above is the detailed content of jQuery usage: dynamic addition of small ads. For more information, please follow other related articles on the PHP Chinese website!