opaque the background when the page loading
-
Hi, I have try to implement the opaque the background when the page loading. (No links or functionality on the main page should be accessible until this page loading is completed). Here am using this code. .......................................................................... ..................................... Default.aspx ..................................... ]]> Untitled Page //---------- function addEvent(obj ,evt, fnc) { if (obj.addEventListener) obj.addEventListener(evt,fnc,false); else if (obj.attachEvent) obj.attachEvent('on'+evt,fnc); else return false; return true; } function removeEvent(obj ,evt, fnc) { if (obj.removeEventListener) obj.removeEventListener(evt,fnc,false); else if (obj.detachEvent) obj.detachEvent('on'+evt,fnc); else return false; return true; } //---------- function appendElement(node,tag,id,htm) { var ne = document.createElement(tag); if(id) ne.id = id; if(htm) ne.innerHTML = htm; node.appendChild(ne); } //---------- function Disablebackground() { // alert('Disable'); greyout(true); } function Enablebackground() { // alert('Enable'); greyout(false); } //---------- function greyout(d) { var obj = document.getElementById('greyout'); if(!obj) { appendElement(document.body,'div','greyout'); obj = document.getElementById('greyout'); obj.style.position = 'absolute'; obj.style.top = '0px'; obj.style.left = '0px'; obj.style.background = '#111'; obj.style.opacity = '.5'; obj.style.filter = 'alpha(opacity=50)'; } //alert(d); if(d) { obj.style.height = document.body.clientHeight+'px'; obj.style.width = document.body.clientWidth+'px'; obj.style.height = Math.max(document.body.scrollHeight,document.body.clientHeight)+'px'; obj.style.width = Mat</x-turndown>