120 days of 1200 hours of pass-through for junior students. NET (10) about jquery (last animated effect *)

Source: Internet
Author: User

1,$ (': Radio '). Val ([' 1 ', ' 2 ', ' 3 ']);//special notation, the value of 1 2 3 is selected.

2,math.abs (len) Take absolute value

3, button highlighting, is generally configured two buttons, a normal, a high brightness (such as Normal style button coordinates of 100,100. The Highlight style button coordinates 120,120), when the mouse passes, JS changes the CSS background-position:100-100; dynamic becomes 120-120. (As for why when you are in a lot of sites to save a small icon, but saved as a large picture, is because the website icon shows the pain of background-position this method)

4,

Effect of text being selected by mouse
1. Extending jquery
$.fn.selectrange = function (start, end) {
var curobj = $ (this). Get (0);
if (!curobj) return;
else if (Curobj.setselectionrange) {
Curobj.focus (); Curobj.setselectionrange (start, end);
}/* WebKit */
else if (Curobj.createtextrange) {
var range = Curobj.createtextrange ();
Range.collapse (TRUE);
Range.moveend (' character ', end);
Range.movestart (' character ', start);
Range.Select ();
}/* IE */
else if (Curobj.selectionstart) {
Curobj.selectionstart = start;
Curobj.selectionend = end;
}
};


Call the Selectrange method directly when calling
. Selectrange (1,7);
Default selected text start to end loading is selected

5,javascript:void (0); no jump

6,$ (This). Parent (). remove ();

7,

Determine if the layer already exists
if ($ (' #dv1 '). length==0) {};

8,

. Hover ()//mouse entry, mouse away
$ (' #btn '). Hover (function () {
$ (this). CSS (' background-color ', ' red ');
}, function () {
$ (this). CSS (' Background-color ', ');
});

9,

Toggle event, toggle ();
$ (' #btn '). Toggle (function () {

}, function () {

}, function () {

}, function () {

});

10, 01: Return False on the inner layer, can prevent event bubbling (recommended)

02:function (e)

E.stoppropagation ();
(Standard usage)

$ (' btn '). Click (function (e) {

if (!confirm (' Go not ')) {
E.prevrntdefault ();//Block Event
}
});

11,

Value is passed when registering an event
$ (' #btn '). Click ({' name ': ' Small Black '},function (evt) {
alert (evt.data.name);
});

12,

Delay hiding and showing
$ (function () {
$ (' #btnHide '). Click (function () {
$ (' div '). Hide (1000);
});
$ (' #btnShow '). Click (function () {
$ (' div '). Show (1000);
});
});

13,*************** animation effects

First out of the document flow
$ (' img '). Animate
({"Top": "550px", "left": "10px", "width": "50px", "height": "50px"},1500)//This is the final result of the picture
; Gradients fall from top to top 550px and become smaller
Animation effects

120 days of 1200 hours of pass-through for junior students. NET (10) about jquery (last animated effect *)

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.