Book Image

Mastering jQuery

By : Alex Libby
Book Image

Mastering jQuery

By: Alex Libby

Overview of this book

<p>Mastering jQuery has been written not only to help maximize your skills with core functionality in the library, but also to explore some of the more intriguing ways of using the library to achieve real-world solutions that could feature on any website or online environment.</p> <p>You'll start with a look at some of the more advanced ways to incorporate the library into your pages, followed by working with forms and advanced form validation using regular expressions. Next you'll move on to animating in jQuery, advanced event handling, and using jQuery effects.</p> <p>Finally, you will develop practical examples of using jQuery with external functionality such as node-webkit, before finishing with a session on optimizing your version of the library for maximum efficiency and exploring best practices for using QUnit.</p>
Table of Contents (21 chapters)
Mastering jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding WebP support to jQuery


At this point, I have a slight confession to make: adding full-blown WebP support to jQuery will probably be outside the scope of this book, let alone fill most of its pages!

Note

WebP is a relatively new image format created by Google, which offers better compression than standard PNG files—you can read more about it at https://developers.google.com/speed/webp/. At present, both Chrome and Opera support this format natively; other browsers will display WebP images once support is added.

The next demo is really about how we can make the switch between two different ways of presenting content on screen, depending on whether our browser supports the newer format. A good example of this is where we might use CSS3 animation wherever possible and fall back to using jQuery for those browsers that do not support CSS3 animation natively.

In our next demo, we're going to use a similar principle to create a monkey patch that overrides the .hasClass() method in order to automatically...