Book Image

jQuery 2.0 Development Cookbook

By : Leon Revill
Book Image

jQuery 2.0 Development Cookbook

By: Leon Revill

Overview of this book

Table of Contents (17 chapters)
jQuery 2.0 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing page elements on mouse hover


jQuery provides many ways to bind mouse event handlers that can give the jQuery developer more control and flexibility than CSS pseudo classes such as :hover. These event handlers make it possible to create a rich and interactive user experience based on user actions.

Note

With the release of jQuery 2.0, jQuery no longer officially supports earlier browsers such as IE6, IE7, and IE8. However, methods such as .hover() can still provide benefits that will allow you to support earlier versions of browsers. Be wary, however, that some parts of the jQuery library may no longer work.

Getting ready

To demonstrate the mouse hover event, we need to firstly create a blank HTML document. Create recipe-7.html in an easily accessible location on your computer.

How to do it…

The following are the steps to understand how jQuery can be used to detect when a user is performing a hover action:

  1. With your newly created HTML document, add the following HTML and CSS code to create...