Exercises
To complete these exercises, you will need the index.html file for this chapter, as well as the finished JavaScript code as found in complete.js. These files can be downloaded from the Packt Publishing website at http://www.packtpub.com/support.
Challenge exercises may require the use of the official jQuery documentation at http://api.jquery.com/.
When Charles Dickens is clicked, apply the
selectedstyle to it.When a chapter title (
<h3 class="chapter-title">) is double-clicked, toggle the visibility of the chapter text.When the user presses the right arrow key, cycle to the next
bodyclass. The key code for the right arrow key is39.Challenge: Use the
console.log()function to log the coordinates of the mouse as it moves across any paragraph. (Note:console.log()displays its results via the Firebug extension for Firefox, Safari's Web Inspector, or the Developer Tools in Chrome or Internet Explorer).Challenge: Use
.mousedown()and.mouseup()to track mouse events anywhere...