This article describes the JS operation of CSS properties to achieve a div layer to expand the closure effect of the method. Share to everyone for your reference. The specific analysis is as follows:
Recently learned JavaScript contact to JS CSS properties of the operation, wrote a turn off effect, at the same time realize the button text switch, very concise Ah! This JS object operation CSS Properties to achieve the expansion of the DIV layer effect. Share the code with the JS front-end designer.
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<title>js Operation Div Unwind </title> <style> #jb51 {border:solid 1px #EEE; background: #F7F7F7; margin:20px; padding:10px; Display:none; width:300px; } </style> <input style= "Cursor:pointer" onclick= "Show (' jb51 ');" type= ' button ' value= ' expand ' id= ' INP ' > < Div id= "jb51" > Script home to provide programming source code, site source code, web material, book tutorials, site templates, Web page special effects codes! </div> <script> function Show (id) {var aiin = document.getElementById (id); var inp= document.getElementById ( ' InP '); if (aiin.style.display!= ' block ') {aiin.style.display = ' block '; inp.value= ' close ';} else{aiin.style.display = ' none '; inp.value= ' expand ';} </script> |
I hope this article will help you with your JavaScript programming.