1. Disable right-click menu
CopyCode The Code is as follows: $ (document). Ready (function (){
$ (Document). BIND ("contextmenu", function (e ){
Return false;
});
});
2. flashing the font
Copy codeThe Code is as follows: jquery. FN. Flash = function (color, duration)
{
VaR current = this.css ('color ');
This. animate ({color: 'rgb ('+ color +') '}, duration/2 );
This. animate ({color: Current}, duration/2 );
}
$ ('# Someid'). Flash ('2017, 255, 1000 );
3. Prepare a document replacement solution Copy codeThe Code is as follows: $ (function (){
// Document is ready do something
});
4. Check the browser Copy codeThe Code is as follows: // Safari
If ($. browser. Safari)
{
// Do something
}
// Above IE6
If ($. browser. MSIE & $. browser. version> 6)
{
// Do something
}
// IE6 and below
If ($. browser. MSIE & $. browser. version <= 6) {// do something} // Firefox 2 and above if ($. browser. mozilla & $. browser. version> = "1.8 ")
{
// Do something
}
5. Check for existing elements
Copy codeThe Code is as follows: if ($ ("# somediv"). Length ){
// Yes it does, do something
}