Articles in this section
Category / Section

Prevent the Dialog content flickering on screen before rendering

1 min read

Description:

Setting showOnInit as false, causes the Dialog content to show on the screen for a second which occurs when loading Dialog in the page.

Solution:

  • To resolve the Dialog content showing before it renders, set the style attribute for the Dialog element or Dialog’s parent element as display none which prevents show the Dialog content to blink on screen.
  • Setting ShowOnInit property as false, only hides dialog after renders, and this will not prevent dialog on initial rendering.

 Please refer the below code snippet for you reference. 

 

HTML:

 
<div class="cols-sample-area">
    <input class="e-btn" id="btnOpen" value="Click to open dialog" />
    <div class="control">
        <div id="basicDialog" style="display:none" title="Audi Q3 Drive">
            <h1>Audi Q3</h1>
            <div class="cnt">
                It is a concept vehicle with Liquid Silver body colour, 20-inch wheels, fabric folding roof, electrically-controlled hood, 4-cylinder 2.0 TDI engine rated 204 PS (150 kW; 201 hp)
                and 400 N·m (295.02 lbf·ft), diesel particulate filter and Bluetec emission control system, quattro permanent four-wheel drive system with Haldex clutch,
                Audi S tronic dual-clutch gearbox, McPherson-strut front axle and a four-link rear axle, Audi drive select system with 3 modes (dynamic, sport, efficiency),
                MMI control panel with touch pad and dual-view technology, sound system with the prominent extending tweeters.
            </div>
        </div>
    </div>
</div>
 
 

 

Javascript:

 
 
  $(function () {
            // declaration
            $("#basicDialog").ejDialog({
                width: 550,
                minWidth: 310,
                minHeight: 215,
                showOnInit:false,
                close: "onDialogClose",
                target: ".control"
            });
 
        });
 
 

 

 

Demo sample: https://jsplayground.syncfusion.com/kskvipaw

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied