Converting the bouncy sprite application into a jQuery plug-in adds
functionality that takes advantage of jQuery’s ability to easily search
for DOM elements via CSS selectors and return them as a list for further
processing. The plug-in will search for any specified elements and attach
bouncySprite instances to them
bouncyBoss object. It will also
allow you to change the background color of the elements being attached to
and the number of
instances being attached.
Although converting the bouncy sprite application into a flexible
jQuery plug-in may sound like a substantial job, there’s actually less
work involved than you might expect. Because of the modular and
self-contained way in which the
bouncyBoss objects were developed, they will
slip unobtrusively into a jQuery plug-in structure.
; // Initial solitary semicolon.
Here, we define an anonymous function. ...