O'Reilly logo

Beginning jQuery by Jack Franklin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 6

image

More Events

At the end of the last chapter, you ended up with a respectable accordion, which was the first major bit of jQuery you’d embarked on. You might not have realized it, but the code you wrote could be tidied up. In this chapter, we’ll finish events by looking at the more advanced features, including:

  • Event delegation
  • Event propagation
  • Preventing default behavior
  • Creating your own events

Once we’ve covered these features, you’ll take another look at your accordion and do some refactoring to improve the code and make it more efficient. Chapter 7 will look at animation in depth, and you’ll again use the accordion example to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required