的CSS
#notificationContainer {
背景颜色:#fff;
边框:1像素实心rgba(100,100,100,.4);
-webkit-box-shadow:0 3px 8px rgba(0,0,0,.25);
溢出-y:自动;
位置:绝对;
顶部:30px;
左边距:-170px;
宽度:400px;
高度:400px;
z-index:9999999;
显示:无;
}
#notificationContainer:之前{
内容:”;
显示:块;
位置:绝对;
宽度:0;
高度:0;
颜色:透明;
边框:10px纯黑色;
边框颜色:透明透明白色;
上边距:-20px;
左边距:188px;
}
#notificationTitle {
z索引:1000;
font-weight:粗体;
填充:8px;
font-size:13px;
背景颜色:#ffffff;
宽度:384像素;
border-bottom:1px实心#dddddd;
text-align:left;
位置:固定 //位置固定为标题工作
}
#notificationsBody {
填充:33px 0px 0px 0px!重要;
最低高度:300像素;
}
#notificationFooter {
背景颜色:#e9eaed;
文本对齐:居中;
font-weight:粗体;
填充:8px;
font-size:12px;
宽度:384像素;
border-top:1px实心#dddddd;
位置:固定 //位置固定不起作用
}
的HTML
<div id="notificationContainer">
<div id="notificationTitle">Notifications</div> //Notification Header
<div id="notificationsBody">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate >
<tr>
<td><asp:Label ID="Label1" …Run Code Online (Sandbox Code Playgroud) Jquery/Javascript:想要在 notification_count_span 淡出并返回 false 后调用 updateNotification() 函数。Web 方法位于母版页中。
<script type="text/javascript" >
$(document).ready(function () {
$("#notificationLink").click(function () {
$("#notificationContainer").fadeToggle(300);
$("#notification_count_span").fadeOut("slow");
return false;
// updateNotification()
});
//Document Click
$(document).click(function () {
$("#notificationContainer").hide();
});
});
function updateNotification() {
$.ajax({
type: "POST",
url: "SiteMaster.master/UpdateNotification",
data: '{nForId: "' + $("#<%=sessionUnameHf.ClientID%>")[0].value + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//alert(msg.d)
//do nothing
}
});
}
</script>
Run Code Online (Sandbox Code Playgroud)
HTML母版页中的 Html 代码。
<asp:Label ID="notification_count_lbl" runat="server" Text=""></asp:Label></span>
<asp:LinkButton ID="notificationLink" runat="server">Notifications</asp:LinkButton>
<!--<a href="#" id="notificationLink1" runat="server" …Run Code Online (Sandbox Code Playgroud)