Simple code for enlarging and downgrading the jQuery div Layer

Source: Internet
Author: User

Copy codeThe Code is as follows: <Head runat = "server">
<Title> </title>
<Style type = "text/css">
. Content
{
Border: 1px solid # ccc;
Width: pixel PX;
Overflow: hidden;
Margin: 10px;
}
</Style>
<Script type = "text/javascript" src = "jquery-1.4.2.min.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
If ($ ('# content'). height ()> 400)
$ ('# Content'). height (400 );
$ ('# Bigger'). toggle (function (){
$ ('# Content'). height ($ (' # content'). height () + 100 );
Certificate ('character bigger'character .html ('downsize ');
}, Function (){
$ ('# Content'). height ($ (' # content'). height ()-100 );
('{Bigger'{.html ('enlarge ');
})
});
</Script>
</Head>
<Body>
<Div id = "content" class = "content">
Content 1 <br/>
Content 2 <br/>
Content 3 <br/>
Content 4 <br/>
Content 5 <br/>
Content 6 <br/>
Content 7 <br/>
Content 8 <br/>
Content 9 <br/>
Content 10 <br/>
Content 11 <br/>
Content 12 <br/>
Content 13 <br/>
Content 14 <br/>
Content 15 <br/>
Content 16 <br/>
Content 17 <br/>
Content 18 <br/>
Content 19 <br/>
Content 20 <br/>
Content 21 <br/>
Content 22 <br/>
Content 23 <br/>
Content 24 <br/>
Content 25 <br/>
</Div>
<Br/>
<Span id = "bigger"> zoom in </span>
</Body>
</Html>
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.