Javascript foldable area implementation code

Source: Internet
Author: User

Key to technical implementation: the display feature of CSS is used. The value of the display feature is none and block. None is hidden, and block is displayed.

Previous design: The foldable area is divided into two areas: the title bar and content area. The title bar is always visible, and the content part can be folded or expanded. On the page, you can use two <div> elements to implement this design.

Steps:
Insert the <div> element into the page and add the JS to implement the folding function.CodeThe Code is as follows:Xmlns = "http://www.w3.org/1999/xhtml">

Click herethis is some content to show and hide.

Click herethis is some content to show and hide.

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.