Opened 11 years ago
Closed 11 years ago
#11779 closed bug (invalid)
toggle() interferes with text of $(this).
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$('<div>', {
id : 'specialButton', text : 'Hide!', click : function() {
$("#headingTypes").toggle();
if($('#headingTypes').is(':visible')) {
$(this).text('Hide!');
} else {
$(this).text('Show!');
}
}
}).insertBefore('#headingTypes');
If we use the above code, the output is as expected: the sections with id headingTypes toggle and the corresponding text is shown (either Hide! or Show!); however the moment we introduce the 'slow' argument to the toggle function, the text doesn't change, i.e. it remains Hide! throughout.
Note: See
TracTickets for help on using
tickets.
Please ask for help on a forum or StackOverflow.