3

Is it possible to hook any inline-css changes without mutation observer but by binding some kind of event or override a prototype?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Villi Katrih
  • 389
  • 1
  • 3
  • 16

1 Answers1

1

There are mutation events (eg DOMAttrModified ) but theyre not supported by all browsers. See:

Event detect when css property changed using Jquery

In JQuery, Is it possible to get callback function after setting new css rule?

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents

But I think the best solution might be to add a prototype method to all html elements which you use to set the css, and use that as your hook.

Its worth noting that changing css isnt async so you can rely on the next line of code firing after the change has happened:

In JQuery, Is it possible to get callback function after setting new css rule?

Community
  • 1
  • 1
Tom Elmore
  • 1,980
  • 15
  • 20