Added compatibility between jQuery versions

Using event.dispatch if available, or event.handle.
Working with jQuery 1.9.1.