Skip to main content

Bug Tracker

Side navigation

#1253 closed enhancement (fixed)

Opened May 29, 2007 08:20PM UTC

Closed February 10, 2008 05:40AM UTC

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)
  • event.js.diff (1.1 KB) - added by brandon June 01, 2007 04:20AM UTC.

    Patch

  • event.js.diff2 (0.9 KB) - added by john June 01, 2007 04:10PM UTC.

    Here's my stab at it - reduce the number of calls to jQuery.event.

  • event.js2.diff (0.9 KB) - added by john June 01, 2007 04:11PM UTC.

    It didn't recognize it as a patch, trying again.

Change History (7)

Changed June 01, 2007 04:21AM UTC by brandon comment:1

need: ReviewTest Case

Changed June 01, 2007 04:18PM UTC by john comment:2

milestone: 1.1.31.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.

Changed June 06, 2007 03:23AM UTC by brandon comment:3

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/

Changed November 20, 2007 11:28PM UTC by brandon comment:4

milestone: 1.21.2.2

I've started work on this in the branch. I've moved the logic directly into the add and remove event functions.

Changed November 20, 2007 11:28PM UTC by brandon comment:5

Replying to [comment:5 brandon]:

That link should be: event_enhancements branch.

Changed February 09, 2008 06:28PM UTC by cloudream comment:6

fixs in r4162

Changed February 10, 2008 05:40AM UTC by davidserduke comment:7

resolution: → fixed
status: newclosed

Fixed as cloudream said again. :)