Opened 16 years ago
Closed 15 years ago
#1253 closed enhancement (fixed)
Allow binding to multiple events simultaneously with .bind()
Reported by: | daemach | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | event | Version: | 1.1.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I was just reading in this cool book "Pro Javascript Techniques" about how it's a good idea to bind events to both keypress and mouse events for accessibility. On that note, I'd like to ask again if you can implement binding to multiple events with bind.
$('#myinput').bind("focus mouseover",function(){doit();})
Attachments (3)
Change History (10)
Changed 16 years ago by
Attachment: | event.js.diff added |
---|
comment:2 Changed 16 years ago by
need: | Review → Test Case |
---|
Changed 16 years ago by
Attachment: | event.js.diff2 added |
---|
Here's my stab at it - reduce the number of calls to jQuery.event.
Changed 16 years ago by
Attachment: | event.js2.diff added |
---|
It didn't recognize it as a patch, trying again.
comment:3 Changed 16 years ago by
Milestone: | 1.1.3 → 1.2 |
---|
Ok, we actually landed this similar functionality for classes in 1.1 (#172), so we should hold this off until 1.2. I've re-tagged the milestone to reflect that.
comment:4 Changed 16 years ago by
This latest patch doesn't work for the one method.
I've created a plugin/extension until we can get this into the core. http://blog.brandonaaron.net/2007/06/05/bind-multiple-events-simultaneously-with-jquery/
comment:5 follow-up: 6 Changed 15 years ago by
Milestone: | 1.2 → 1.2.2 |
---|
I've started work on this in the branch. I've moved the logic directly into the add and remove event functions.
comment:6 Changed 15 years ago by
Replying to brandon:
That link should be: event_enhancements branch.
comment:8 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed as cloudream said again. :)
Patch