jQuery Tutorial (Part 4) – Event Listeners

Click to go to articles parent site->>jQuery Tutorial (Part 4) â€" Event Listeners


jQuery Tutorial (Part 4) â€" Event Listeners
Pulpit rock
Today we’re going to kick it up a notch and really show where jQuery shines – events. If you followed the past tutorials, you should now have a fairly good understanding of the basic code structure of jQuery (and all the horrible curly braces that go with it), as well as how find elements of the DOM and some of things you can do to manipulate them. I also showed you how to access the developer console in Chrome and how you might use it to debug your jQuery code. Events – among other uses – let you react to things that happen on the page and user interactions – clicking, scrolling, and all that fancy stuff. What Is An Event Anyway? For those new to programming that involves a graphical interface of some kind, events refer to any kind of interaction between the user and the application; or can be generated internally by some other process. Applications choose which events to “listen for”, and when that event is triggered, they can react in some way. For example, tapping on your iPhone screen will generate a single “tap event” with an x,y coordinate of precisely where you tapped. If you tapped on a particular object, like a button, it’s likely that the button was listening for that event and will perform some action accordingly. If it was just a blank part of the interface, nothing was attached to the event and so nothing will happen. Dragging your finger across the screen would generate another event, one which include

Read More

            Google+