How can I mirror/copy/sync some CSS properties from one HTML element to another using JavaScript?

Viewed 18

I have an HTML element that gets it's width/height/transform/translate CSS properties modified using the style attributed by a third-party library that handles image zoom and panning.

I hooked into this library's lifecycle events to add a mouse-hover overlay on top of the image, and I would like to sync the width/height/transform/translate properties of the base image to the overlayed image.

Is there a way to detect these changes and copy the styles without polling at regular intervals?

Thanks!

0 Answers
Related