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.

Also, the problem is that there is a placeholder in my page and this div tag does not show as it is shown on previous pages.
Please can somebody help me out
Thanks so much!!!!!!!!!

The code I have used is:
Div Tage Code:

Help with Code Tags html Syntax (Toggle Plain Text)

<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> <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.

Help with Code Tags JavaScript Syntax (Toggle Plain Text)

<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><script language="javascript" type="text/javascript">        
function doRefresh()
{
    javascript<b></b>:__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>

the codebehind which calls javascript functions is:

private void CheckSessionTimeout()
        {
            Session.Timeout = 2;
            //Response.Write("<script language=javascript type=text/javascript>");
            //time to remind, 5 minutes before session end        
            int int_MilliSecondsTimeReminder = (Session.Timeout * 60000) - 1 * 60000;
            //time to redirect, 5 miliseconds before session end    
            int int_MilliSecondsTimeOut = (Session.Timeout * 60000) - 5;
            StringBuilder sb = new StringBuilder();
            //sb.AppendLine("<script language=\""javascript"\" +" " +type="\"text/javascript\"">");
            sb.AppendLine(@"<script language=""javascript"" type=""text/javascript"">");
            //sb.AppendLine("<script language=javascript type=text/javascript>");
            sb.AppendLine("var myTimeReminder, myTimeOut;");
            sb.AppendLine("clearTimeout(myTimeReminder);");
            sb.AppendLine("clearTimeout(myTimeOut);");
            sb.AppendFormat("var sessionTimeReminder = {0};\n", int_MilliSecondsTimeReminder);
            sb.AppendFormat("var sessionTimeout = {0};\n", int_MilliSecondsTimeOut);
            sb.AppendLine("myTimeReminder=setTimeout('showUserMessage()', sessionTimeReminder);");
            sb.AppendLine("myTimeOut=setTimeout('doRedirect()', sessionTimeout);");
            sb.AppendLine("</script>");
            Page.RegisterClientScriptBlock("CheckSessionOut", sb.ToString());
        }

>I have a div tag and working fine till yesterday.

Runs yesterday's code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.