This article mainly introduces the left-side advertisement code for JS to achieve clickable expansion and closure, and uses the onClick event to call a custom javascript function to display and hide page elements and styles, it is very simple and practical. If you need it, you can refer to the examples in this article to describe the code for opening and closing the advertisement on the left. Share it with you for your reference. The details are as follows:
This section describes the advertisement code on the left that can be clicked to expand or close on the JS implementation webpage. The expression is similar to the couplet advertisement, but the operation method is different. when clicked, the code will be hidden on the left of the screen, but it is not completely hidden. It still displays an advertisement with a vertical picture. When you click "show", it will re-open the advertisement, which can improve the user experience on the webpage.
The running effect is as follows:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-click-show-close-style-adv-codes/
The Code is as follows:
Click the expanded or closed advertisement code on the webpage.Close
Expand