I am looking to create a versatile function that can effortlessly overlay various elements such as selects, textfields, inputs, divs, tables, and more with a partially transparent div matching their exact height and width.
I have managed to obtain the position and dimensions of the element:
$(element).height()
$(element).width()
$(element).offset().top
$(element).offset().left
However, I am uncertain how to synchronize the element's position and size with the div. I need the div to adjust if the element's position or size changes. Any suggestions on how to achieve this? Alternatively, is there a jQuery plugin available for this functionality? I believe this would be beneficial for temporarily blocking an element for user interaction during operations such as AJAX requests.
Thank you.