Bug Tracker

Modify

Ticket #7921 (closed enhancement: invalid)

Opened 3 years ago

Last modified 3 years ago

.click() does not trigger event bound with .toggle()

Reported by: jmagner@… Owned by:
Priority: undecided Milestone: 1.next
Component: event Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by jitter) (diff)

If an event handler is bound using .toggle(),

$('#elem').toggle(function(e){
  console.log('toggle state 1');
}, function(e){
  console.log('toggle state 2');
}, function(e){
  console.log('toggle state 3');
});

There should be a way to invoke an event on this.

$('#elem').click(); does not work

This would be particularly useful in cases where you'd want to 'hide' something when another, outside event occurred.

Change History

comment:1 Changed 3 years ago by rwaldron

  • Status changed from new to closed
  • Resolution set to invalid

toggle() is not intended to respond to the 'click' event, unless you specify and trigger the click event on the specified element.

Version 1, edited 3 years ago by rwaldron (previous) (next) (diff)

comment:4 Changed 3 years ago by jitter

  • Component changed from unfiled to event
  • Description modified (diff)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.