or
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RadControlsWebApp4._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
</
div
>
<
script
type
=
"text/javascript"
>
var firstNotificationShowTime = 0;
var firstNotificationHideTime = 0;
var firstNotificationStatus;
var timer;
$(document).ready(function () {
var firstNotification = $find("<%=RadNotificationFirst.ClientID %>");
$("#TextBoxFirstNotificationShowInterval").val(firstNotification.get_showInterval() / 1000);
$("#TextBoxFirstNotificationHideInterval").val(firstNotification.get_autoCloseDelay() / 1000);
firstNotificationShowTime = firstNotification.get_showInterval() / 1000;
firstNotificationStatus = "show";
setTimeout("CountInterval()", 0);
timer = setInterval("CountInterval()", 1000);
});
function CountInterval() {
if (firstNotificationStatus == "show") {
if (firstNotificationShowTime > 0) {
firstNotificationShowTime -= 1;
$("#tdOutputFirst").html("Notification will show after " + firstNotificationShowTime + " seconds");
}
}
else {
if (firstNotificationHideTime > 0) {
firstNotificationHideTime -= 1;
$("#tdOutputFirst").html("Notification will hide after " + firstNotificationHideTime + " seconds");
}
}
}
function ChangeNotificationTimer() {
var firstNotification = $find("<%=RadNotificationFirst.ClientID %>");
var firstNotificationShowInterval = $("#TextBoxFirstNotificationShowInterval").val();
var firstNotificationHideInterval = $("#TextBoxFirstNotificationHideInterval").val();
firstNotification.set_showInterval(firstNotificationShowInterval * 1000);
firstNotification.set_autoCloseDelay(firstNotificationHideInterval * 1000);
firstNotificationShowTime = firstNotification.get_showInterval() / 1000;
firstNotificationHideTime = firstNotification.get_autoCloseDelay() / 1000;
return false;
}
function OnClientShown(sender, args) {
firstNotificationStatus = "hide";
firstNotificationHideTime = sender.get_autoCloseDelay() / 1000;
}
function OnClientHidden(sender, args) {
firstNotificationStatus = "show";
if (sender.get_keepOnMouseOver() == false) {
firstNotificationShowTime = (sender.get_showInterval() - sender.get_autoCloseDelay()) / 1000;
}
else {
firstNotificationShowTime = sender.get_showInterval() / 1000;
}
}
function ToggleKeepOnMouseOver(args) {
var Notification;
Notification = $find("<%=RadNotificationFirst.ClientID %>");
var keepOnMouseOver = Notification.get_keepOnMouseOver();
if (keepOnMouseOver == true) {
Notification.set_keepOnMouseOver(false);
}
else {
Notification.set_keepOnMouseOver(true);
}
}
</
script
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
style
=
"margin: 0 auto;"
>
<
tr
>
<
td
class
=
"tdLeftContent"
>
First Notification Show Interval
</
td
>
<
td
class
=
"tdRightContent"
>
<
asp:TextBox
ID
=
"TextBoxFirstNotificationShowInterval"
runat
=
"server"
></
asp:TextBox
>
second
</
td
>
</
tr
>
<
tr
>
<
td
>
First Notification Hide Interval
</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBoxFirstNotificationHideInterval"
runat
=
"server"
></
asp:TextBox
>
second
</
td
>
</
tr
>
<
tr
>
<
td
>
KeepOnMouseOver
</
td
>
<
td
>
<
asp:CheckBox
ID
=
"CheckBoxFirstNotificationKeepOnMouseOver"
Checked
=
"true"
runat
=
"server"
Text
=
""
onclick
=
"return ToggleKeepOnMouseOver('first');"
/>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"text-align: center;"
colspan
=
"4"
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Change"
OnClientClick
=
"return ChangeNotificationTimer();"
/>
</
td
>
</
tr
>
<
tr
>
<
td
id
=
"tdOutputFirst"
style
=
"text-align: center;"
colspan
=
"2"
>
</
td
>
<
td
id
=
"tdOutputSecond"
style
=
"text-align: center;"
colspan
=
"2"
>
</
td
>
</
tr
>
</
table
><
div
id
=
"print"
></
div
>
<
telerik:RadNotification
ID
=
"RadNotificationFirst"
runat
=
"server"
Position
=
"Center"
ShowInterval
=
"7000"
AutoCloseDelay
=
"4000"
Width
=
"300"
Height
=
"200"
Title
=
"First Notification"
OffsetX
=
"0"
OffsetY
=
"0"
OnClientShown
=
"OnClientShown"
OnClientHidden
=
"OnClientHidden"
TitleIcon
=
""
EnableRoundedCorners
=
"true"
>
</
telerik:RadNotification
>
</
form
>
</
body
>
</
html
>