aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-05 09:14:15 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-05 09:14:15 +0000
commit887b890fa672183f7d6d754ac18478e036a7beb2 (patch)
tree556f32351162a41805084bbf06d08543482a01ae
parent150262153be3fcf1bbc7438d9b4c76d1d1d3bd6b (diff)
downloadjquery-887b890fa672183f7d6d754ac18478e036a7beb2.tar.gz
jquery-887b890fa672183f7d6d754ac18478e036a7beb2.zip
fixed typo (easeout); added check if jQuery._$ even exists, added examples for usage of $.noConflict()
-rw-r--r--src/fx/fx.js2
-rw-r--r--src/jquery/jquery.js25
2 files changed, 22 insertions, 5 deletions
diff --git a/src/fx/fx.js b/src/fx/fx.js
index 9aa17a914..6c0d0cff6 100644
--- a/src/fx/fx.js
+++ b/src/fx/fx.js
@@ -528,7 +528,7 @@ jQuery.extend({
return delta*(n/=duration)*n*n + firstNum;
},
- easeou: function(p, n, firstNum, delta, duration) {
+ easeout: function(p, n, firstNum, delta, duration) {
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
},
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 3d9e3042a..c551041bc 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1069,15 +1069,32 @@ jQuery.extend({
* of other libraries.
*
* By using this function, you will only be able to access jQuery
- * using the 'jQuery' variable. For example, where you use to do
+ * using the 'jQuery' variable. For example, where you used to do
* $("div p"), you now must do jQuery("div p").
*
+ * @example $.noConflict();
+ * @desc Maps the original object that was referenced by $ back to $
+ *
+ * @example $.noConflict();
+ * (function($) {
+ * $(function() {
+ * // more code using $ as alias to jQuery
+ * });
+ * })(jQuery);
+ * // other code using $ as an alias to the original implementation (not jQuery)
+ * @desc Reverts the $ alias and then creates and executes a
+ * function to provide the $ as a jQuery alias inside the functions
+ * scope. Inside the function the original $ object is not available.
+ * This works well for most plugins that don't rely on any other library.
+ *
+ *
* @name noConflict
* @type undefined
* @cat Core
*/
- noConflict: function(){
- $ = jQuery._$;
+ noConflict: function() {
+ if(jQuery._$)
+ $ = jQuery._$;
},
/**
@@ -1086,7 +1103,7 @@ jQuery.extend({
* @type undefined
* @cat Core
*/
- init: function(){
+ init: function() {
jQuery.initDone = true;
jQuery.each( jQuery.macros.axis, function(i,n){