How to Implement div layer expansion and closure by using css properties in js _ javascript tips-js tutorial

Source: Internet
Author: User
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 close

The 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.