This article mainly introduces how to implement the div layer expansion and Closure Effect by operating css attributes in javaScript. It involves javaScript operations on css styles to implement the div pop-up layer effect, which is of great practical value, if you need it, refer to the example in this article to describe how to implement the close effect of the p layer by operating the css attribute of js. Share it with you for your reference. The specific analysis is as follows:
Recently, I learned how to operate css attributes in javascript. I wrote an extension and close effect, and implemented button text switching, which is very concise! This Js object operates the css attribute to implement the close and unexpand effect on the p layer. Share the Code with the JS front-end designer.
Js operation p expand and closeThe script home provides programming source code, website source code, webpage materials, book tutorials, website templates, and webpage special effect code!
Script function show (id) {var aiin = document. getElementById (id); var indium = document. getElementById ('power1'); if (aiin. style. display! = 'Block') {aiin. style. display = 'block'; indium. value = 'close';} else {aiin. style. display = 'none'; indium. value = 'expand ';} script
I hope this article will help you design javascript programs.