------后台
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; public partial class _1_右下角滑动通知_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public string GetDialog() { return setRightDialog("通知", 250, "<a href=‘http://www.55xue.com‘ target=‘_black‘>尊敬的顾客朋友,您IQ卡余额不足10元,请及时充值</a>", "face-sad"); } /// <summary> /// 右下角滑动通知 /// </summary> /// <param name="title">弹出框标题</param> /// <param name="width">宽度</param> /// <param name="content">内容(可以加上标签)</param> /// <param name="icon">图标(如下,选择一个图标的名称)</param> /// <returns></returns> private string setRightDialog(string title, int width, string content, string icon) { StringBuilder sb = new StringBuilder(); sb.Append("<script type=\"text/javascript\">"); sb.Append(" $(function () { "); sb.Append(" art.dialog.notice({ "); sb.AppendFormat("title: \"{0}\",", title); sb.AppendFormat("width:{0},", width.ToString()); sb.AppendFormat("content:\"{0}\",", content); sb.AppendFormat("icon:\"{0}\",", icon); sb.AppendFormat("time:{0}", "5"); sb.Append(" }); "); sb.Append(" }); "); sb.Append("</script>"); return sb.ToString(); } }
------前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_1_右下角滑动通知_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 runat="server"> <title></title> <style> body { font-size:75%; color:#666; font-family:‘Microsoft Yahei‘, Tahoma, Arial!important; font-family:‘宋体‘, Tahoma, Arial;} </style> <script src="../artDialog/artDialog.js?skin=default"></script> <script src="../artDialog/plugins/iframeTools.js"></script> <script src="../artDialog/ZD.artDialog.js" type="text/javascript"></script> <%-- <script type="text/javascript"> $(function () { art.dialog.notice({ title: ‘万象网管‘, width: 220, // 必须指定一个像素宽度值或者百分比,否则浏览器窗口改变可能导致artDialog收缩 content: "<a href=‘http://www.55xue.com‘ target=‘_black‘>尊敬的顾客朋友,您IQ卡余额不足10元,请及时充值</a>", icon: ‘face-sad‘, time: 5 }); }); </script>--%> </head> <body> <form id="form1" runat="server"> <!----------前台调用--------------> <%=GetDialog() %> <!----------前台调用--------------> </form> </body> </html>
源代码下载:http://down.51cto.com/data/1968050
新建群:426634651
本文出自 “程序猿的家--Hunter” 博客,请务必保留此出处http://962410314.blog.51cto.com/7563109/1597216
原文地址:http://962410314.blog.51cto.com/7563109/1597216