[JQ authoritative guide] Day 17th: Show () and Hide () method

Source: Internet
Author: User

(1) Function description
When displaying a large amount of text content, in order to be able to display more paragraph content, sometimes only one part of the feed is displayed, hiding the other part of the content.
(2) Code

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-type" Content="text/html; Charset=utf-8 " /><title>Show () and Hide () method</title><script type="text/jscript" src="... /jquery-2.1.4.js "></script><style>    Body{  font-size:px;}     . Artfram{  border:solid 1px #ccc;  background-color:#eee;  width:260px;  padding:8px;  word-break:break-all  }. Artlist{  line-height:1.8em  }</style><script type="Text/javascript" >$( function(){        var$link =$ (". Artlist a");//Get click Text        var$hide =$ (". Artlist:eq (2)");//Get hidden paragraphs$link. Click ( function(){        //Text Click event            if( $( This). html () = ="Show"){//If not shown$( This). HTML ("Hide");//Change the content of the text$hide. Show ();//Show hidden text}Else{                $( This). HTML ("Show");                $hide. Hide (); }            })        })</script></head><body>    <div class="Artfram">        <div class="Artlist">        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>        <span>A good program developer, in addition to mastering the professional development language, but also to have</span>        <span style="Display:none">Persistent, steady, meticulous professional quality</span>&nbsp;<a href="javascript:void (0)">Show</a>        </div>    </div></body></html>


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

[JQ authoritative guide] Day 17th: Show () and Hide () method

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.