Resize and repositon div using javascript
问题 I'm trying to do a simple resize and reposition of a div element that shows a ajax loading image. The content it loads can change size, so I want the div element to resize to be the size of the parent, which in this case is a table dimension with the id "thEngineCategories". function resize_divProgress() { var control = document.getElementById('thEngineCategories'); var div = document.getElementById('divProgress'); div.style.left = control.offsetLeft + 'px'; div.style.top = control.offsetTop