Skip to content
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

How to make it work with dynamically created elements #22

Open
DrLightman opened this issue Dec 22, 2015 · 3 comments
Open

How to make it work with dynamically created elements #22

DrLightman opened this issue Dec 22, 2015 · 3 comments

Comments

@DrLightman
Copy link

I have some dynamically created elements by third party scripts and I want to modify and/or remove attributes from them.

But it seems that this plugin can't intercept those elements, am I right?

@meetselva
Copy link
Owner

Do you have a call back function that will be called after the elements are created? If yes, you could call the attrchange function after the elements are created.

Post relevant code or an example so that I can see if there is an alternate solution.

@DrLightman
Copy link
Author

It's a third party javascript for advertising that creates these elements, not even hosted in my space, it can be, for example, an Adsense or similar.

Let say at some point, after DOM is loaded, a DIV is populated with other DIVs, and I want to remove the style attribute of those DIVs, eg:

<div id="parent-div">
<div class="nasty-child-div" style="width:160px">hello</div>
</div>

I'd like to get rid of style="width:160px", so I can be free to apply my CSS rules to that DIV, otherwise the inline style forbids me to do so.

@meetselva
Copy link
Owner

Yea, It is hard to monitor such dynamic includes. One other solution is to use a timer to check if the nasty-child-div is added to your content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants