diff --git a/css/macdefault.css b/css/macdefault.css index 64fea21..180132f 100644 --- a/css/macdefault.css +++ b/css/macdefault.css @@ -607,7 +607,6 @@ body { width: calc(100% - 20px); min-height: 40px; padding:10px; - margin-top: 4px; transition: background-color 0.5s; position: relative; } @@ -617,19 +616,12 @@ body { animation-duration: 0.5s; } -#win10_command_center .msgs .msg:hover{ - cursor: default; - background-color: rgba(255, 255, 255, 0.19); -} -#win10_command_center .msgs .msg:hover .title{ +#win10_command_center .command-body .notice:hover .notice-body{ color: #333; } -#win10_command_center .msgs .msg:hover>.btn_close_msg{ - color: grey; -} -#win10_command_center .msgs .msg:hover>.content{ - color: #333; +#win10_command_center .command-body .notice:hover>.notice-header .btn_close_msg{ + color: grey; } #win10_command_center .msgs .msg>.title{ @@ -638,13 +630,14 @@ body { line-height: 28px; } -#win10_command_center .msgs .msg>.btn_close_msg{ +#win10_command_center .command-body .notice .notice-header>.btn_close_msg{ cursor: pointer; color: transparent; - padding: 3px; - position: absolute; - top: 11px; - right: 11px; + margin-right: 8px; + font-size: 15px; + display: inline-block; + text-align: right; + float: right; } #win10_command_center .msgs .msg>.btn_close_msg:hover{ diff --git a/demo.html b/demo.html index 1dc89a1..f2fca1c 100644 --- a/demo.html +++ b/demo.html @@ -33,7 +33,18 @@ setTimeout(function () { Win10.newMsg('推荐全屏', '按下F11全屏以达到最佳视觉效果(点击进入)',function () { Win10.enableFullScreen(); - }) + }); + Win10.newMsg('最新资讯', '最新资讯信息',function () { + layer.open({ + type: 2, + title: '最新资讯', + area: ['300px', '380px'], + shade:0, + skin:'win10-open-iframe', + offset: 'rb', + content: './broadcast.html' + }); + }); }, 1500); setTimeout(function () { @@ -106,12 +117,37 @@
-
-

消息中心

- 全部清除 +
+
今天
+
通知
-
-
+
+
+
1月6日 星期日
+
戊戌年十二月初一
+
+
+
+ + 天气 +
+
+
+
+ 下午3:54 + 广州市 +
+
+ 多云 +
+
17
+
+
+
+
+ +
+
diff --git a/index.html b/index.html index 762ff76..480d42c 100644 --- a/index.html +++ b/index.html @@ -98,46 +98,9 @@
-
-
- - 天气 -
-
-
-
- 下午3:54 - 广州市 -
-
- 多云 -
-
17
-
-
-
-
-
-
- - 天气 -
-
-
-
- 下午3:54 - 广州市 -
-
- 多云 -
-
17
-
-
-
-
+
diff --git a/js/mac.js b/js/mac.js index 070c4e0..c973627 100644 --- a/js/mac.js +++ b/js/mac.js @@ -295,14 +295,16 @@ window.Win10 = { Win10.menuClose(); Win10.commandCenterClose(); }); - $('#win10').on('click',".msg .btn_close_msg", function () { - var msg = $(this).parent(); + $('#win10').on('click',".notice .btn_close_msg", function () { + var msg = $(this).parents('.notice'); + console.log(msg); $(msg).addClass('animated slideOutRight'); setTimeout(function () { msg.remove() }, 500) }); + //消息界面切换 $('#win10_command_center').on('click',".command-header .tab-today", function () { if (!$(this).hasClass('active')) { $('#win10_command_center .command-body.msgs').hide(); @@ -310,7 +312,8 @@ window.Win10 = { $(this).addClass('active').siblings('div').removeClass('active'); } }); - + + //消息界面切换 $('#win10_command_center').on('click',".command-header .tab-msg", function () { if (!$(this).hasClass('active')) { $('#win10_command_center .command-body.today').hide(); @@ -654,12 +657,21 @@ window.Win10 = { this.commandCenterClose(); } }, - newMsg: function (title, content,handle_click) { - var e = $('
' + - '
' + title +'
'+ - '
' + content + '
' + - '' + - '
'); + newMsg: function (title,content,handle_click,app_name='提示消息',app_icon='',is_del=true) { + var msg = '
' + + '
' + + ''+app_icon+'' + + ''+app_name+''; + if (is_del) { + msg += ''; + } + msg +='
' + + '
' + + '
' + + '
' + title +'
'+ + '
' + content + '
' + + '
'; + var e = $(msg); $("#win10_command_center .msgs").prepend(e); e.find('.content:first,.title:first').click(function () { if(handle_click){