Update div (to view it redraw)

In a web application, I encounter some problems with dynamic content - where, in the form hidden or shown above the jQuery ui control, there are problems with processing until the user clicks on them and then the tab header to redraw in the right place.

This only happens in IE7, and as a quick hack, I do this after the form is displayed, to force the div div to update in IE:

$('#tabs').css('display', 'none').css('display', 'block');

I'm just wondering if there is a more suitable / reliable way to get the div element to redraw itself / recount the layout of the elements on the page, as I am worried that my approach may have unwanted side effects for other browsers.

+3
source share
2 answers

I had a similar problem with this once, it turned out to be a problem when the width was not set on the displayed div. When I set the static width of the px in the element in which it worked.

+2
source

Wild hunch, but maybe hasLayout.

Try adding something like:

#tabs {
  zoom: 1;
}
+4
source

Source: https://habr.com/ru/post/1705222/


All Articles