You can't. if you're trying it than it's a bad user experience. JavaScript does not work in that way because long running JavaScript synchronous jobs block the browser's UI (everything on Ui), including image animations.
And the bad news is a majority of browser crashes are caused by badly
constructed JavaScript loops.
That's why no loading image will show during the execution of your loop.
Here is the fiddle
HTML:
<button class="k-button" id="progressStartButton" >Loading Start ......</button>
<div id="tabStripCompany">
<ul>
<li class="k-state-active">Loading Example</li>
</ul>
<!-- Settings tab -->
<div id="settingsTab" >
<div id="customerSettingsLoading" ></div>
<div id="customerSettings">
</div>
</div>
<div >
More stuff here...
</div>
</div>
JavaScript:
kendo.ui.progress($("#customerSettings"), true);
setInterval(function(){
kendo.ui.progress($("#customerSettings"), false);
$("#progressStartButton").text("Loading End !")
}, 3000)
$("#tabStripCompany").kendoTabStrip();
CSS:
#customerSettings {
position: relative;
}
#customerSettings{height:200px}