jQuery Pocket Reference

jQuery Pocket Reference

CHAPTER 9 Extending jQuery with Plugins

It is almost trivially easy to write your own jQuery extensions.
The trick is to know that jQuery.fn is the prototype object for
all jQuery objects. If you add a function to this object, that
function becomes a jQuery method. Here is an example:

jQuery.fn.println = function() {
// Join arguments into a space-separated string
var msg = Array.prototype.join.call(arguments, " ");
// Loop through each element in the jQuery object
this.each(function() {
// For each one, append the string as plain text,
jQuery(this).append(document.createTextNode(msg))
.append("<br/>"); // then append a <br/>.
});
// Return the jQuery object for method chaining
return this;
};   

CHAPTER 10 The jQuery UI Library

As its name implies, jQuery UI defines a number of user interface
widgets: auto-completion input fields, date pickers for entering
dates, accordions and tabs for organizing information,
sliders and progress bars for visually displaying numbers, and
modal dialogs for urgent communication with the user.

你可能感兴趣的:(jQuery Pocket Reference)