JQuery is a good framework. The following summarizes five tips that every website developer should know:
1. Disable right-click menu
$ (Document). ready (function (){
$ (Document). bind ("contextmenu", function (e ){
Return false;
});
});
2. flashing the font
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
$ (Function (){
// Document is ready do something
});
4. Check the browser
// Safari
If ($. browser. safari)
{
// Do something
}
// Above IE6
If ($. browser. msie & amp; $. browser. version & gt; 6)
{
// Do something
}
// IE6 and below
If ($. browser. msie & amp; $. browser. version & lt; = 6) {// do something} // Firefox 2 and above if ($. browser. mozilla & amp; $. browser. version & gt; = "1.8 ")
{
// Do something
}
5. Check for existing elements
If ($ ("# someDiv"). length ){
// Yes it does, do something
}