Fragmented knowledge points and common effects

Source: Internet
Author: User

Click the text to prevent the text from being selected:

* {
-moz-user-select:-moz-none;
-moz-user-select:none;
-o-user-select:none;
-khtml-user-select:none;
-webkit-user-select:none;
-ms-user-select:none;
User-select:none;
}

Future elements: Live

You can attach an event to an element that has not yet been created.

Writing format: $ (". Div"). Live ("Click", Function () {})

Color Gradient
Refer to jquery packaged jquery.color.js to the desired page

Index () method

Returns the index position of the specified element relative to the other specified element.

These elements can be specified by JQuery selectors or DOM elements.

Custom Animation Additions:
Animate ({left: "value", Top: "Value"}, Execution time, function () {callback
function//callback function Optional})//rotation cannot do

Stop animation to prevent animation from accumulating:. Stop ()

Mouse move into small hands:

Cursor:pointer;

Word Wrapping:

Word-wrap:break-word;

Bubble Window Mask

Some knowledge points of pop-up window making
Get browser height: var llbo = window.innerheight;
Get page height: var bo = $ ("Body"). Outerheight ();
Line break: Word-wrap:break-word

Text self-adapting

The first type of notation:

<style type= "Text/css" > * {margin:0px;        padding:0px;            } #box {position:relative;            width:300px;            Height:auto;        Word-wrap:break-word; } </style><script type= "Text/javascript" >$ (document). Ready (function () {var p = $ ("#box"). HTML (            );            $ ("#box"). HTML (p.substring (0, 48));            $ ("#box"). HTML ($ ("#box"). HTML () + "...") $ ("#box"). Toggle (function () {$ ("#box"). HTML (P);                }, Function () {$ ("#box"). HTML (p.substring (0, 48)); $ ("#box"). HTML ($ ("#box"). HTML () + "...")});        </script> <div id= "box" > 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 </div> 

Second type

<style type= "Text/css" > * {margin:0px;        padding:0px;            } #box {position:relative;            width:300px;            Height:auto;            Word-wrap:break-word;            White-space:nowrap;            Text-overflow:ellipsis;            Overflow:hidden;        Cursor:pointer; } </style> <script type= "Text/javascript" > $ (Function () {$ (' #box '). Toggle (Function (            {$ (this). CSS (' white-space ', ' normal ', ' text-overflow ', ' initial ', ' backgroundcolor ', ' yellow '); }, Function () {$ (this). CSS (' white-space ', ' nowrap ', ' text-overflow ', ' ellipsis ', ' backgroundcolor ', '            White ');        });    }); </script>

Third (simple notation)

  

Fragmented knowledge points and common effects

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.