ShareThis

Thursday, July 19, 2012

ascx control causing shift when viewing page (loading late)

This is a pretty simple fix. The problem is that the control loads late (possibly waiting for the server response to populate its data). The fix is to wrap the controls in a <div> element. Then set the style attribute:

<div id="controlWrapper" style="display:hidden;">
controls
</div>

You can use javascript or jquery to set the display style once the controls have loaded, so they display at the same time and no shifting occurs.

0 comments:

Post a Comment