admin管理员组文章数量:1319015
In a web application, I'm hitting some troubles with dynamic content - whereby a form being hidden or shown above a jQuery UI tab control causes rendering issues until the user hovers there mouse over the tabs, which then causes the tab header to redraw in the correct location.
It's only occurring in IE7 and as a quick hack I'm doing this after showing the form to cause the tab's div to be refreshed in IE:
$('#tabs').css('display', 'none').css('display', 'block');
I'm just wondering if there is a more appropriate/robust way to cause a div
element to redraw itself/recalculate the layout of elements on a page, as I'm worried my approach may have unwanted side-effects on other browsers.
In a web application, I'm hitting some troubles with dynamic content - whereby a form being hidden or shown above a jQuery UI tab control causes rendering issues until the user hovers there mouse over the tabs, which then causes the tab header to redraw in the correct location.
It's only occurring in IE7 and as a quick hack I'm doing this after showing the form to cause the tab's div to be refreshed in IE:
$('#tabs').css('display', 'none').css('display', 'block');
I'm just wondering if there is a more appropriate/robust way to cause a div
element to redraw itself/recalculate the layout of elements on a page, as I'm worried my approach may have unwanted side-effects on other browsers.
2 Answers
Reset to default 4Wild guess, but could be hasLayout
.
Try adding something like:
#tabs {
zoom: 1;
}
I had a similar issue to this once, it turned out to be an issue with the width not being set on the displaying div. When I set the static px width on the element it worked.
本文标签: javascriptRefreshing div (cause browse to redraw it)Stack Overflow
版权声明:本文标题:javascript - Refreshing div (cause browse to redraw it) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742051956a2418102.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论