Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to hook any inline-css changes

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

like image 395
Villi Katrih Avatar asked Mar 22 '26 13:03

Villi Katrih


1 Answers

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?

like image 192
Tom Elmore Avatar answered Mar 24 '26 03:03

Tom Elmore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!