电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

右下角弹出类似QQ或MSN消息提示


发布日期:2022/12/31
 

<SCRIPT language=JavaScript>

<!

/**//*

* 消息构造

*/

function CLASS_MSN_MESSAGE(idwidthheightcaptiontitlemessagetargetaction){

thisid = id;

thistitle = title;

thiscaption= caption;

ssage= message;

thistarget = target;

thisaction = action;

thiswidth = width?width:;

thisheight = height?height:;

thistimeout= ;

thisspeed = ;

thisstep = ;

thisright = screenwidth ;

thisbottom = screenheight;

thisleft = thisright thiswidth;

thistop = thisbottom thisheight;

thistimer = ;

thispause = false;

thisclose = false;

thisautoHide = true;

}

/**//*

* 隐藏消息方法

*/

CLASS_MSN_MESSAGEprototypehide = function(){

if(thisonunload()){

var offset = thisheight>thisbottomthistop?thisheight:thisbottomthistop;

var me = this;

if(thistimer>){

windowclearInterval(metimer);

}

var fun = function(){

if(mepause==false||meclose){

var x = meleft;

var y = ;

var width = mewidth;

var height = ;

if(meoffset>){

height = meoffset;

}

y = mebottom height;

if(y>=mebottom){

windowclearInterval(metimer);

mePophide();

} else {

meoffset = meoffset mestep;

}

mePopshow(xywidthheight);

}

}

thistimer = windowsetInterval(funthisspeed)

}

}

/**//*

* 消息卸载事件可以重写

*/

CLASS_MSN_MESSAGEprototypeonunload = function() {

return true;

}

/**//*

* 消息命令事件要实现自己的连接请重写它

*

*/

CLASS_MSN_MESSAGEprototypeoncommand = function(){

//thisclose = true;

thishide();

windowopen();

}

/**//*

* 消息显示方法

*/

CLASS_MSN_MESSAGEprototypeshow = function(){

var oPopup = windowcreatePopup(); //IE+

thisPop = oPopup;

var w = thiswidth;

var h = thisheight;

var str = <DIV style=BORDERRIGHT: # px solid; BORDERTOP: #abcf px solid; ZINDEX: ; LEFT: px; BORDERLEFT: #abcf px solid; WIDTH: + w + px; BORDERBOTTOM: # px solid; POSITION: absolute; TOP: px; HEIGHT: + h + px; BACKGROUNDCOLOR: #cdf>

str += <TABLE style=BORDERTOP: #ffffff px solid; BORDERLEFT: #ffffff px solid cellSpacing= cellPadding= width=% bgColor=#cfdef border=>

str += <TR>

str += <TD style=FONTSIZE: px;COLOR: #fcc width= height=></TD>

str += <TD style=PADDINGLEFT: px; FONTWEIGHT: normal; FONTSIZE: px; COLOR: #fb; PADDINGTOP: px vAlign=center width=%> + thiscaption + </TD>

str += <TD style=PADDINGRIGHT: px; PADDINGTOP: px vAlign=center align=right width=>

str += <SPAN title=关闭 style=FONTWEIGHT: bold; FONTSIZE: px; CURSOR: hand; COLOR: red; MARGINRIGHT: px id=btSysClose >×</SPAN></TD>

str += </TR>

str += <TR>

str += <TD style=PADDINGRIGHT: px;PADDINGBOTTOM: px colSpan= height= + (h) + >

str += <DIV style=BORDERRIGHT: #bcef px solid; PADDINGRIGHT: px; BORDERTOP: #eb px solid; PADDINGLEFT: px; FONTSIZE: px; PADDINGBOTTOM: px; BORDERLEFT: #eb px solid; WIDTH: %; COLOR: #fb; PADDINGTOP: px; BORDERBOTTOM: #bcef px solid; HEIGHT: %> + thistitle + <BR><BR>

str += <DIV style=WORDBREAK: breakall align=left><A javascript:void() hidefocus=false id=btCommand><FONT color=#ff> + ssage + </FONT></A> <A ommand><FONT color=#ff>网页素材下载站</FONT></A></DIV>

str += </DIV>

str += </TD>

str += </TR>

str += </TABLE>

str += </DIV>

oPopupdocumentbodyinnerHTML = str;

thisoffset = ;

var me = this;

oPopupdocumentbodyonmouseover = function(){mepause=true;}

oPopupdocumentbodyonmouseout = function(){mepause=false;}

var fun = function(){

var x = meleft;

var y = ;

var width = mewidth;

var height = meheight;

if(meoffset>meheight){

height = meheight;

} else {

height = meoffset;

}

y = mebottom meoffset;

if(y<=metop){

metimeout;

if(metimeout==){

windowclearInterval(metimer);

if(meautoHide){

mehide();

}

}

} else {

meoffset = meoffset + mestep;

}

mePopshow(xywidthheight);

}

thistimer = windowsetInterval(funthisspeed)

var btClose = oPopupdocumentgetElementById(btSysClose);

btCloseonclick = function(){

meclose = true;

mehide();

}

var btCommand = oPopupdocumentgetElementById(btCommand);

btCommandonclick = function(){

meoncommand();

}

var ommand = oPopupdocumentgetElementById(ommand);

ommandonclick = function(){

//thisclose = true;

mehide();

windowopen(ommandhref);

}

}

/**//*

** 设置速度方法

**/

CLASS_MSN_MESSAGEprototypespeed = function(s){

var t = ;

try {

t = praseInt(s);

} catch(e){}

thisspeed = t;

}

/**//*

** 设置步长方法

**/

CLASS_MSN_MESSAGEprototypestep = function(s){

var t = ;

try {

t = praseInt(s);

} catch(e){}

thisstep = t;

}

CLASS_MSN_MESSAGEprototyperect = function(leftrighttopbottom){

try {

thisleft = left !=null?left:thisrightthiswidth;

thisright = right !=null?right:thisleft +thiswidth;

thisbottom = bottom!=null?(bottom>screenheight?screenheight:bottom):screenheight;

thistop = top !=null?top:thisbottom thisheight;

} catch(e){}

}

var MSG = new CLASS_MSN_MESSAGE(aa短消息提示您有封消息懒人图库);

MSGrect(nullnullnullscreenheight);

MSGspeed = ;

MSGstep = ;

//alert(MSGtop);

MSGshow();

//同时两个有闪烁只能用层代替了不过层不跨框架

//var MSG = new CLASS_MSN_MESSAGE(aa短消息提示您有封消息好的啊);

// MSGrect(nullnullscreenheight);

// MSGshow();

//>

</SCRIPT>

上一篇:VBScript基础教程之十一VBScript与窗体

下一篇:禁止鼠标右键的几种方法