-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply selectivizr after DOM modifications #18
Comments
Currently, there is no automatic solution to this but it is something I'm trying to develop but it's not an easy feature to just "bolt on" You could manually add the selectivizr classes to your new objects before adding them to the DOM. It's not ideal, but it would allow you to move on. |
I'm also needing this right now too. I'm fine to add the classes manually in the mean time. Do you have any documentation on what classes to add? |
The best way to find that out would be to use IE developer tools to see which classes were added to the elements your modifiying. They all begin with |
And what about to bind DOMNodeInserted Javascript event and filter the selectivizr targets and then apply the appropriate CSS attributes? |
Unfortunately, IE6-8 do not support |
Ouch! , and try to rescan the new nodes manualy. Something like: $("<tr><td>Row 5</td></tr>").appendTo("table tbody");
$("<tr><td>Row 6</td></tr>").appendTo("table tbody");
$("table tbody").selectivizr();
// At this point, all the new nodes in this context have the appropriate CSS attributes What do you think? |
It's actually kind of difficult, as it implies, for example nth-child(3n-2) to keep track of the parent, remove styles to children created and apply the class again just to the ones that match. Not impossible, but requires a bit of thinking |
Tracking this issue as this is something that would have been handy at this very moment :-) Not an easy to do thing though… |
It would be nice to be able to at least re-run Selectivizr on the whole document... |
@PikachuEXE, i've just tried it and it does work. Thank you. ^_^ |
Hello,
First of all thanks for this great tool.
So, my question is if it's possible to apply the CSS after DOM modifications?
An example:
The HTML file:
The CSS file:
The javascript code:
In this example the 'Row 6' dont' appears in color red, because the style of new nodes is not applied.
Is there a solution?
Thanks!
The text was updated successfully, but these errors were encountered: