JavaScript implementation columns display tips _javascript tips

Source: Internet
Author: User

Remember to give Shige the test system, see their examination page can realize hidden left examinee information part, at that time feel good tall, good humanization. Now that I've learned JavaScript, I can do this, and here's a little bit of a show-off.

1. Page Design:

(1). html code:

<title>js columns </title> <style type= "Text/css" > alignment{text-align:center; 
} </style>  

(2). Description: In fact this page is very simple, just a row of three columns of the table. The first part puts the column name, the third part is the main content. The middle part puts a picture of the Left (right) arrow, before thought many, thought is a very cow control.

2.javascript Code:

<script language= "javascript" type= "Text/javascript" > 
function Hide ()/Click left arrow, hide section 
{ 
// The first step: Hide the column list 
document.getElementById ("Lanmu"). style.display= "None"; 
Step Two: Change the arrow picture at the same time, the event that the left arrow responds to IS Display show () 
document.getElementById ("pic"). Innerhtml= " '; 
} 
function Show ()//Click the right arrow to display the Hidden columns section 
{ 
//First step: Display column list 
document.getElementById ("Lanmu"). style.display= " "; 
Step Two: Change the arrow picture at the same time, the event that the left arrow responds to is hidden hide () 
document.getElementById ("pic"). Innerhtml= " '; 
} 
</script>

(1) Effect:

(2) Description: The original display is "left arrow", click on the picture will respond to hide () event, the section is hidden, while the left ARROW to the right arrow. When you click on the "right Arrow" will respond to show () event, showing the hidden section of the column, while the right arrow for the left arrow, and back to the original state. This is actually very simple, it is easy to do.

Through this stage of JavaScript learning, it is very interesting. In the case of nothing before, always think hard, give yourself psychological pressure, when the personal experience of the time, found that it is so, slowly cultivate the interest in learning. Now log in to a website or use a software, will not consciously consider how it is achieved, where to do well, where need to improve, gradually to a professional person.

JavaScript to learn a lot of things, today is only showing the tip of the iceberg, with interest and curiosity to continue to refuel!

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.