我昨天的成果–常驻右下角的消息提示
var msgClass = function(){
this.init = function(){
var msgDiv = “<div id = ”msg_show” style=”position: fixed; bottom: 0px; right: 0px; _position: absolute; display: none;”>” +
“<a id = ”msg_show_a” href=”javascript:void(0);”>” +
“<div style=”float: left; width: 200px; height: 30px; font-size: 12px; color: #f00; line-height: 30px; text-align: left; position: relative; border: 1px #ccc solid; background-color: #eff;”>” +
“<img src=”/common/images/xx.gif” width=”11” height=”11” style=”float: left; margin: 9px; display: inline;” />” +
“您有新的消息,请注意查收!” +
“</div>” +
” </a>” +
“</div>” +
“<div id=”msg_block” style=”position: fixed; bottom: 30px; right: 0px; _position: absolute; display: none;”>” +
“<div style=”float: left; width: 200px; height: 140px; position: relative; border: 1px #ccc solid; background-color: #eff; overflow-x:hidden; overflow-y:scroll”>” +
“<ul class=”xxx” id=”msg_content”>” +
“</ul>” +
“</div>” +
“</div>”;
$(“body”, window.parent.document).append(msgDiv)
$(“#msg_show_a”, window.parent.document).click(function(){msg_click()});
}
var msg_click = function(){
var msgDiv = window.parent.document.getElementById(“msg_block”);
if (“none” == msgDiv.style.display) {
msgDiv.style.display = “block”;
} else {
msgDiv.style.display = “none”;
}
}
this.getMessage = function() {
$.ajax( {
tyep : “POST”,
url : “/msg/getPromptMsgInfo.action”,
success : function(msg) {
var json = eval(msg);
var num = json.length;
if (num != 0) {
$(“#msg_show”,window.parent.document).css(“display”, “”);
$(“#msg_content”, window.parent.document).empty();
for ( var i = 0; i < num; i++) {
var title = json[i].TITLE.substr(0, 12);
var sub = “<li title=””
+ json[i].TITLE
+ “”><a id =”a_”+i+”” href=”javascript:void(0)” >”
+ title
+ “</a></li>”;
var MSG_ID=json[i].MSG_ID;
var RELATION_ID=json[i].RELATION_ID;
$(“#msg_content”, window.parent.document).append(sub);
$(“#a_”+i, window.parent.document).click(“{‘MSGID’:'”+MSG_ID+”‘,’RELATIONID’:'”+RELATION_ID+”‘}”,
function(e){
msgSelected(e.data);










