javascript - How to insert an advertisement at the top of the page without destroying the page layout (without affecting the content below)?
我想大声告诉你2017-07-05 10:40:45
0
4
1062
is a long advertisement at the top, pushing down other content. Directly inserting a p img will not work, as it will cause the underlying content to be misaligned or cover up. Can it be solved using js/jquery?
Generally, advertisements on web pages are a piece of js code. It is easier to place ads in this way. The function of the js code is to request materials, create dom elements, adjust the layout, and handle the display and click logic. If the line is troublesome, you can directly set an iframe.
To prevent the content below from being misaligned or covered, you can just create a translucent overlay advertisement. Use pointer-events:none and apply pointer-events:none to the translucent overlay element. The content behind the translucent overlay can be seen. Get it, you can also perform click events For details, please refer to the master http://www.zhangxinxu.com/stu...
Wrap it with a p
Generally, advertisements on web pages are a piece of js code. It is easier to place ads in this way. The function of the js code is to request materials, create dom elements, adjust the layout, and handle the display and click logic. If the line is troublesome, you can directly set an iframe.
If the ad space is 100% wide and 200px high
To prevent the content below from being misaligned or covered, you can just create a translucent overlay advertisement. Use pointer-events:none and apply pointer-events:none to the translucent overlay element. The content behind the translucent overlay can be seen. Get it, you can also perform click events
For details, please refer to the master
http://www.zhangxinxu.com/stu...