This is what i have tried
I had used YUI for this and added a panel to my code when the button is click
var ANIM_LOAD = YAHOO.namespace("anim_load");
ON button_onClick()
{
StartInitialLoadingPanel("Loading");
}
StartInitialLoadingPanel(msgStrng)
{
if (!TAB_COLLECTION.wait) {
// Initialize the temporary Panel to display while waiting for external content to load
TAB_COLLECTION.wait = new YAHOO.widget.Panel("wait",
{ width: "400px",
x: window.screen.center,
fixedcenter: true,
close: false,
draggable: false,
zindex:1000,
modal: true,
visible: true
}
);
TAB_COLLECTION.wait.setHeader(msgStr);
TAB_COLLECTION.wait.setBody("<img src='../Images/loading_animation'>");
TAB_COLLECTION.wait.render(document.body);
}
// Show the Panel
TAB_COLLECTION.wait.show();
}
When the background is executed successfully you can call the method for stopping the animation as
function CancelInitialLoadPanel()
{
//Hide the Panel
if (TAB_COLLECTION.wait)
{
TAB_COLLECTION.wait.hide();
}
}
Thanks for more details you can see Here