Bug Tracker

Modify

Ticket #9693 (closed bug: fixed)

Opened 23 months ago

Last modified 23 months ago

Inconsistency of document and code for .toggleClass

Reported by: anferneeg Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: neededdocs Cc:
Blocking: Blocked by:

Description

In document, it said

.toggleClass( function(index, class), [switch] )

But more precisely, the function should be something like function(index, class, switch).

Source code,  https://github.com/jquery/jquery/blob/master/src/attributes.js

jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );

and sample code:  http://jsfiddle.net/slater/sDVfK/2/

Either document or code should be modified.

Change History

comment:1 Changed 23 months ago by timmywil

  • Keywords neededdocs added
  • Priority changed from undecided to low
  • Status changed from new to closed
  • Component changed from unfiled to attributes
  • Resolution set to fixed

Thank you! docs updated:  http://api.jquery.com/toggleClass/

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.