18Sticky navigation


jQuery plugins

In the last section (slow scrolling), we just used plain jQuery to achieve everything that we wanted.

With the sticky navigation we are going to use our first jQuery plugin.

jQuery plugins are third party bits of code (they’ve been written by somebody else) that expand or add to the methods available to the jQuery library

It is fair to say that most plugins are free to use, some you have to pay for, but most and indeed all the ones I installed within this website are free — you don’t have to pay for them.

These plugins are available under some form of Open Source licence.

Generally, these types of licence allow you, me or anyone to use the plugin free of charge and do pretty much what we like with it: modify it, include it in our code, even sell it in some cases. The only thing we have to do is acknowledge the author of the code and include the licence within our own software (I do this on the acknowledgments page of the website; I also include the licences as comments in the various files that make up the website).

The thing we can’t do with software that uses this form of licencing is attach any blame to the author, the licences all contain phrases such as:

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

I.e. by using it you indemnify the author against any liability or losses you may incur when using it. This is fair enough, you got it for nothing.

jQuery itself is made available under the MIT Open Source licence (the same one I use for the downloadable version of this website).

We will use jQuery plugins in much the same way that we use the normalize.css file crated by Messrs Gallagher and Neal — we download it and incorporate it into our website.

End flourish image