May 2017
Intermediate to advanced
448 pages
10h 10m
English
In illustrating the ability of the click event to operate on normally non-clickable page elements, we have crafted an interface that doesn't indicate that the style switcher label--just an <h3> element-is actually a live part of the page awaiting user interaction. To remedy this, we can give it a rollover state, making it clear that it interacts in some way with the mouse:
.hover { cursor: pointer; background-color: #afa; }
The CSS specification includes a pseudo-class called :hover, which allows a stylesheet to affect an element's appearance when the user's mouse cursor hovers over it. This would certainly solve our problem in this instance, but instead, we will take this opportunity to introduce jQuery's .hover()
Read now
Unlock full access