S
smartwebcoder
Hi I have again tried some common functionality that we all need some
times.
Below is the Javascript Function which You can call on any event to
Disable your webpage.
// Function made to disable Page
/**********************************************************/
var divtemp;
function DisablePage()
{
divtemp = document.createElement("div");
divtemp.style.top = 0;
divtemp.style.left = 0;
//divtemp.style.height = screen.height;
//divtemp.style.width = screen.width;
//divtemp.style.height = document.forms[0].offsetHeight;
//divtemp.style.width = document.forms[0].offsetWidth;
divtemp.style.height = window.document.body.clientHeight;
divtemp.style.width = window.document.body.clientWidth;
divtemp.style.position = "absolute";
divtemp.id = "divIdName";
divtemp.className = 'disablePage';
divtemp.style.zIndex = 998;
var arrForm = document.getElementsByTagName("Form");
arrForm[0].appendChild(divtemp)
//
document.getElementById("divtemp").appendChild("floatlayer");
document.getElementById("dvDialog").style.zIndex = 999;
}
/**********************************************************/
Below is the css that will you the feel that yes Page is got
Disabled.
..disablePage
{
position: absolute;
z-index: 500;
top: 0px;
left: 0px;
height: 80%;
width: 80%;
filter: alpha(opacity=90);
background-color: Transparent;
background-color: gold;
background-image: none;
background-repeat: repeat;
display: block;
}
/**********************************************************/
Below code shows how to call DisablePage() function.
<input type="button" value="Disable Page" onClick="DisablePage()" />
Please feel free to comment on my Little Javascript.
times.
Below is the Javascript Function which You can call on any event to
Disable your webpage.
// Function made to disable Page
/**********************************************************/
var divtemp;
function DisablePage()
{
divtemp = document.createElement("div");
divtemp.style.top = 0;
divtemp.style.left = 0;
//divtemp.style.height = screen.height;
//divtemp.style.width = screen.width;
//divtemp.style.height = document.forms[0].offsetHeight;
//divtemp.style.width = document.forms[0].offsetWidth;
divtemp.style.height = window.document.body.clientHeight;
divtemp.style.width = window.document.body.clientWidth;
divtemp.style.position = "absolute";
divtemp.id = "divIdName";
divtemp.className = 'disablePage';
divtemp.style.zIndex = 998;
var arrForm = document.getElementsByTagName("Form");
arrForm[0].appendChild(divtemp)
//
document.getElementById("divtemp").appendChild("floatlayer");
document.getElementById("dvDialog").style.zIndex = 999;
}
/**********************************************************/
Below is the css that will you the feel that yes Page is got
Disabled.
..disablePage
{
position: absolute;
z-index: 500;
top: 0px;
left: 0px;
height: 80%;
width: 80%;
filter: alpha(opacity=90);
background-color: Transparent;
background-color: gold;
background-image: none;
background-repeat: repeat;
display: block;
}
/**********************************************************/
Below code shows how to call DisablePage() function.
<input type="button" value="Disable Page" onClick="DisablePage()" />
Please feel free to comment on my Little Javascript.