Javascript closure functions for explicit and hidden content _ javascript skills

Source: Internet
Author: User
The main advantage of using the closure function for explicit and hidden content is to increase the display and hiding efficiency.

<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta name = "Generator "CONTENT =" EditPlus "> <meta name =" Author "CONTENT =" "> <meta name =" Keywords "CONTENT =" "> <meta name =" Description "CONTENT = ""> <style type = 'text/css '>. a {width: 200px; font-size: 12px; font-weight: bold; height: 30px; line-height: 30px; background: url (/images/default/header_bg.gif ); Margin-top: 5px ;}. a {text-Decoration: none ;}. aa {width: 200px; height: 100px; border: 3px groove # 91D2FF; display: none ;} </style> </HEAD> <BODY> <p id = "a" title = "a1" class = 'A'> + Click to display </p> <p id = "a1" class = 'aa' style = 'display: block'> love and worry-free, my idol is fruit </p> <p id = "B" title = "b1" class = 'A'> + Click to display </p> <p id = "b1 "class = 'A'> carefree, fruit I worship you, don't worry, fruit I worship you </p> <p id = "c" title = "c1" class = 'A'> + Click Show </p> <p id = "c1" class = 'A'> no worries about love and care about baby fruits every day, pay attention to the image fruit every day </p> <p id = "d" title = "d1" class = 'A'> + Click to display </p> <p id = "d1" class = 'A'> carefree, love Fruit, love fruit, Love Fruit </p> <script language = "JavaScript"> <! -- Var Each = function (a, fn) {for (var I = 0; I SCRIPT </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.