CHAPTER 10

image

Extending jQuery

jQuery’s easy-to-use syntax led developers to begin writing scripts to achieve custom effects and other tasks. To make these scripts configurable and reusable, these developers constructed them as plug-ins, or scripts that extend jQuery by adding new methods to the library. In this chapter, you’ll learn how to add your own plug-ins to jQuery.

Adding Functions to jQuery

In some cases, it may be desirable to add a function directly to the jQuery object, which means you would be able to call it like so:

$.yourFunction();

Adding functions to jQuery can help you keep your scripts organized and ensure that your function ...

Get Pro PHP and jQuery, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.