Demo:
Hướng dẫn:
1. Tạo 1 trang JS mới
- Title: Popup message- Placement: Chọn vị trí bạn muốn đặt (In all the pages - tất cả các trang, In the portal - Chỉ hiện ở Portal, hoặc các bạn có thể chọn In the home page - Chỉ hiện ở home page)
- Code:
- Code:
$(function() {
$('body').after('<div id="message-popup" class="hide" onclick="$(\'.hide\').toggle(\'fast\');"></div><div id="content" class="hide"><p>Nội Dung Tin Nhắn</p></div>');
});
2. Cho đoạn này vào CSS
- Code:
/*----- POPUP MESSAGE ---*/
#message-popup {
background: #000000;
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 1000;
margin: 0 auto;
opacity: 0.1;
}
#content-message {
box-shadow: 0px 3px 3px 0px rgba(100,100,100,0.5);
-moz-box-shadow: 0px 3px 3px 0px rgba(100,100,100,0.5);
-webkit-box-shadow: 0px 3px 3px 0px rgba(100,100,100,0.5);
width: 550px;
height: 300px;
position: fixed;
z-index: 1000;
padding: 10px 25px;
left: 33%;
top: 30%;
border-left: 5px solid green;
border-radius: 4px;
background: #ffffff;
font-size: 15px!Important;
}