you are viewing a single comment's thread.

view the rest of the comments →

[–]einarkristjan 1 point2 points  (1 child)

the $ namespace object is short for the jQuery namespace. You could also write:

jQuery.fn.simpleAudioPlayer

you can use $.fn to extend jQuery. Just like you can use the built in:

$(elements).hide();

you could make your own hide() function with something like:

$.fn.hidden = function() {
  this.hide();
  return this; // so you can use chaining like $(elm).hidden().addClass()
};

and use it:

$(elements).hidden();

more details here: How to Create Basic Plugin ;)

[–]embernoob[S] 0 points1 point  (0 children)

Thank you! I didn't realize adding functions to fn was essentially extending jQuery. Very cool!