Bug Tracker

Modify

Ticket #10400 (closed feature: invalid)

Opened 20 months ago

Last modified 20 months ago

Leveraging the powers of .live()

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: misc Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:

Description

If we already have such a great feature as .live() it would be awesome if one could call .live() with a function as the only paramater. e.g.

$('.greenDivs').live(function() {

$(this).css('color','green');

});

This would make all .greenDivs elements green, existing and newly added ones. It's like the livequery plugin does. I think this feature would be useful enough to add it to the main library.

Change History

comment:1 Changed 20 months ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to misc

live is awful.

The behaviour you describe is actually _exactly_ how CSS works already.

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.