Side navigation
#5409 closed enhancement (wontfix)
Opened October 27, 2009 04:51AM UTC
Closed November 20, 2010 02:27AM UTC
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: | ||
Blocked by: | Blocking: |
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.
Attachments (0)
Change History (3)
Changed November 19, 2010 02:23AM UTC by comment:1
owner: | john → david71rj |
---|---|
status: | new → pending |
Changed November 19, 2010 03:04AM UTC by comment:2
Changed November 20, 2010 02:27AM UTC by comment:3
resolution: | → wontfix |
---|---|
status: | pending → closed |
Basically, you’re describing CSS, except using the slowest mechanism possible. And also a little of DOM mutation events.
Can you provide a test case?