var lSpinner$, lPromise; apex.util.delayLinger.start( "main", function() { lSpinner$ = apex.util.showSpinner( $( "#ofcdetails" ) ); } ); setTimeout( function() { lSpinner$.remove(); }, 5000);