Using jQuery to scale text boxes and move up and down _ jquery

Source: Internet
Author: User
I would like to share with you a piece of code that is very practical and often used in projects. This Code is based on jQuery to implement the text box zoom and move up and down functions, for more information, see the following code. Would you like to make your webpage more cool and make your comments more interactive? Please study this code carefully.

JQuery code:

The Code is as follows:


$ (Function (){
Var $ comment = $ ('# comment ');
$ ('. Bigger'). click (function (){
If (! $ Comment. is (": animated ")){
If ($ comment. height () <500 ){
// $ Comment. height ($ comment. height () + 50 );
$ Comment. animate ({height: "+ = 50"}, 400 );
}
}
});
$ ('. Smaller'). click (function (){
If (! $ Comment. is (": animated ")){
If ($ comment. height ()> 50 ){
// $ Comment. height ($ comment. height ()-50 );
$ Comment. animate ({height: "-= 50"}, 400 );
}
}
});
$ ('. Up'). click (function (){
If (! $ Comment. is (": animated ")){
$ Comment. animate ({scrollTop: "-= 50"}, 400 );
}
});
$ ('. Low'). click (function (){
If (! $ Comment. is (": animated ")){
$ Comment. animate ({scrollTop: "+ = 50"}, 400 );
}
});
});

HTML code:

The Code is as follows:




Zoom in
Zoom out
Up
Down



<Br/> water, electricity, water, power, toner, France, sfafen sofa, relax, relax, and relax sofa <br/> water, electricity, water, electricity, and toner sofa, fa, Fa when a sofa Fa <br/>



CSS code:

The Code is as follows:


. Bigger,. down,. up,. smaller {
Background-color: # f1a55c;
}

The code is provided. I will not say much about how to use it and where it is used. Let's make full use of it.

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.