Thursday, August 15, 2013

Show Loading on Page using JAVASCRIPT


Easy way to show loading Image Using HTML and JavaScript.
Put any image in images/loading/loading.gif
<div id="divLoading" style="display: none;">
 <div class="PreLoadingEffectDiv">
 <img src="images/loading/loading.gif" />
 </div>
 <div class="PreLoadingEffect">
 </div>
 </div>
 <script language="javascript" type="text/javascript">

 if (document.getElementById('divLoading') != null) {

 document.getElementById('divLoading').style.display = "";
 }
 function HideLoading() {

 document.getElementById('divLoading’).style.display = "none";

 }
 </script>
.PreLoadingEffect
 {
 position: absolute;
 left: 20px;
 top: 0px;
 left: 0px;
 opacity: 0.7;
 filter: alpha(opacity=70);
 z-index: 1000;
 height: 1000%;
 width: 100%;
 background-color: #777777;
 }
 .PreLoadingEffectDiv
 {
 position: fixed; left: 50%; top: 50%; z-index: 2000;
 }

1 comment:

Note: Only a member of this blog may post a comment.