Hi,
i call JS function to display a confirmation message and place it at the top of the window for 5 seconds as follows:
C#:
ScriptManager.RegisterStartupScript(UpdatePanel3, UpdatePanel3.GetType(), "ShowCurrentTime", "ShowCurrentTime();", true);
JS:
var i = 0;
function ShowCurrentTime() {
document.getElementById("Message").style.display = 'block';
var dt = new Date();
i++;
if (i == 5) {
i = 0;
document.getElementById("Message").style.display = 'none';
return false;
}
window.setTimeout("ShowCurrentTime()", 1000); // Here 1000(milliseconds) means 1 sec
return false;
}
CSS:
.messageboxGreen
{
background-color: #FFFFFF;
color: #28b007;
font-size: large;
width:200px;
height:61px;
margin:0 auto;
display:none;
text-align:center;
border-color:grey;
border-style:solid;
border-width:1px;
}
ASPX:
<div>
<div id="Message" class="messageboxGreen">
<div style="padding-top:5px;">
<asp:Label ID="lblMessage" runat="server" style=" font-weight:bold; font-size:large;"></asp:Label>
</div>
<div style="padding-top:11px;">
<asp:Image ID="imgPNGLogo" runat="server" Width="30px" ImageUrl="~/images/V.png"/>
</div>
</div>
</div>
Now, somtimes the calling executing when the user scroll down the page so he can't see the popup message.
My question is how can i display the popup message at the top, BUT accordingly to the scroller that the user will be able to see it?
Thanks