(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> </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> <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