Hi there,
I have a div tag and working fine till yesterday. Just now I found out a problem which has to be rectified quickly.
I have a div tag. When time out is approaching then we need to pop up the message using div tag. Everything is working fine.
But on the page, where is the div tag is created, at the run time, it is showing the empty space.
How can I remove the empty space (div tag is invisible) on the page.
When I have used style="position: absolute;" the div tag is not shown when the user scrolls down the browser.
So with the help of ppl in this forum, I hv changed to style="position: fixed;"
The same code is working in the other page (it is not showing empty space). But on another page it is showing empty space. The div code is same all through out. I am not able to make out why the same code is working differently on different pages.
The code I have used is:
Div Tage Code:
<div onload="blurAll();" id="userMessage" style="position: fixed; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px;
visibility:hidden; border: 3px solid blue; width: 383px;">
<table style="width: 388px; height: auto; background-color:Blue;">
<thead align="left" title="Registration - Warning">
<tr>
<td style="color:White;">Registration - Warning
</td>
</tr>
</thead>
</table>
<table style="width: 388px; height: auto; background-color:ButtonFace;">
<tr> <td><img src="triangle.jpg"id="img" alt="warning" /></td>
<td>
You are inactive for sometime. Your session will expire in 5 min.<br />
Do you wish to extend?
</td>
</tr>
<tr><td></td><td align="center">
<asp:Button CssClass="groupButton" ID="btnStillHere" OnClientClick="doRefresh()" Text="OK" runat="server" Width="60px" />
<input type="button" class="groupButton" id="btnDoNothing" onclick="hideUserMessage()" value= "Cancel" runat="server" />
</td> </tr>
</table>
</div>
Java Script used to show and hide message.
Some code is in .net. where I call the javascript function.
<script language="javascript" type="text/javascript">
function doRefresh()
{
javascript:__doPostBack('');
}
function donothing()
{
}
//window.location.href=window.location.href; }
function doRedirect()
{
setObjectVisibility("userMessage","hidden");
setObjectVisibility("exitMessage","visible");
// setTimeout(1000);
//window.location.href='loginPage.aspx';
}
function RedirectPage()
{
window.location.href='loginPage.aspx';
}
function getStyleObject(objectId)
{
// checkW3C DOM, then MSIE 4, then NN 4.
if(document.getElementById && document.getElementById(objectId))
return document.getElementById(objectId).style;
else if (document.all && document.all(objectId))
return document.all(objectId).style;
else if (document.layers && document.layers[objectId])
return document.layers[objectId];
else
return false;
}
function setObjectVisibility(objectId, newVisibility)
{
var styleObject = getStyleObject(objectId);
if (styleObject)
{
styleObject.visibility = newVisibility;
return true;
}
else
return false;
}
function showUserMessage()
{
setObjectVisibility("userMessage","visible");
window.focus=false;
}
function hideUserMessage()
{
setObjectVisibility("userMessage","hidden");
}
function blurAll()
{
alert("blur");
window.blur();
}
</script>
pls help me. Its quite urgent.
Thanks a lot in advance.
Regards