Jq
1, prepend (parameter);//The parameter content is placed in front of an element inside;
eg
<div id= "Div1" > Magical Ability Song </div>
$ ("#div1"). Prepend ("<a href= ' # ' > Chen Tablets </a>");
Results: <div id= "Div1" ><a href= ' # ' > Chen granule </a> marvelous Song </div>
2.
Outerheight (Boolean)
Outerheight (false);//calculation of the margin value of an element padding and border
Outerheight (TRUE);//The margin value of the calculated element
3. Delay (time);
eg:$ ("#div1"). Delay () show ();//The element delays 300ms and performs the display;
4. Set scroll bar dynamic sliding
$ (document). ScrollTop ();//scroll bar height
$ ("body"). Animate ({scrolltop:500px},500);
5. Open a new window
window.open ("url");
6. Binding multiple events with the same class name, using the Ligatures method
eg
$ ("#focus"). KeyDown (function () {
Xx
}). focus (function () {
Xxx
});
7, Sprite background map
. Icon Icon-1
<span class= "icon icon-1" ></span>
. Icon{background:url (') no-repeate;}
. icon-1{background-position:-24px-100px;}
The background graph does not show that
Solve:
. Icon{background-image:url ('); background-repeate:no-repeate;}
. icon-1{background-position:-24px-100px;}
8, the interface
If <div><a></a><a></a></div>
The A tag has an IMG tag with an img height of 88, but in fact the div has a height of 92, "Forest Blank Node"
Workaround: Add Vertical-align:middle to the IMG tag, or img{display:block;} a{font-size:0;}
Compatibility:
IE7: to make overflow:hidden; effective, it needs to add position:relative to its parent element;
CSS Attention Small Dot