Bug Tracker

Modify

Ticket #5409 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 3 years ago

Apply function every on create a new element

Reported by: david71rj Owned by: david71rj
Priority: minor Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

On create a new element on screen, is need review all.

See: $('table td.even').each(function() {

$(this).css('background: red')

});

Okay, this works, but if, after, you add a new element inner this table, this don't will get red background (if even).

-TABLE-

-TR-TD-[red]

-TR-TD-

~AFTER SCRIPT, NEW:~

-TR-TD-[not red :(]

I suggest any as:

$('table td:even').every(function(){

$(this).css('background: red');

})

Then, if you add a new HTML element, this will be verified before, then apply the function relactive.

This is possible?

Bye.

Change History

comment:1 Changed 3 years ago by dmethvin

  • Owner changed from john to david71rj
  • Status changed from new to pending

Can you provide a test case?

comment:2 Changed 3 years ago by anonymous

This currently not is a feature, but is interesting.

Read more here:  http://jsfiddle.net/XEW7X/

Bye.

comment:3 Changed 3 years ago by snover

  • Status changed from pending to closed
  • Resolution set to wontfix

Basically, you’re describing CSS, except using the slowest mechanism possible. And also a little of DOM mutation events.

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.