复制代码代码如下:
<!-开始->
<style type = "text/css">
#msg_win {Posição: absoluto; direita: 0px; display: Nenhum; Overflow: Hidden; Z-Index: 99; Border: 1px Solid #C00; Background: #f9effc; largura: 210px; Font-Size: 12px; Margin: 0px;}
#msg_win .iCos {Posição: Absoluto; topo: 2px;*topo: 0px; direita: 2px; z-index: 9;}
.iCos a {float: esquerda; cor: #ffffff; margem: 1px; text-align: Center; Fonte-peso: negrito; largura: 14px; altura: 22px; altura de linha: 22px; preenchimento: 1px; text-decoração: nenhum; Font-family: webdings;}
.iCos a: hover {color:#ffcc00;}
#MSG_TITLE {Background: #FA6705; Border-Bottom: 1px Solid #710B97; Border-top: 1px Solid #FFF; Border-left: 1px Solid #fff; cor: #ffff; altura: 25px; Linha: 25px; text-indent: 5px; Feight;
#msg_content {margem: 1px; margem-direita: 0; largura: 210px; altura: 160px; transbordamento: hidden; Alinhamento de texto: centro}
</style>
<!-结束->
<div id = "msg_win" style = "display: block; top: 503px; visibilidade: visível; opacidade: 1;">
<div> <a id = "msg_min" href = "javascript: void 0"> _ </a> <a id = "msg_close" href = "javascript: void 0"> × </a> </div>
<div id = "msg_title"> 标题
</div>
<div id = "msg_content">
<Object ClassID = "CLSID: D27CDB6E-AE6D-11CF-96B8-444553540000"
CodeBase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">
<param name = "filme" value = "flvplayer.swf? vcastr_file = userLogin/video/qlg.flv & isautoplay = 1"/>
<param name = "Quality" value = "High"/>
<param name = "peritofullscreen" value = "true" />
<incorpado src = "flvPlayer.swf? vCastr_file = userLogin/video/qlg.flv & isautoplay = 1" perroffullscreen = "true" Quality = "High"
pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "Application/x-hockwave-flash"> </bed>
</ject>
</div>
</div>
<script type = "text/javascript">
var mensagem = {
SET: function () {// 最小化与恢复状态切换
var set = this.minbtn.status == 1? [0, 1, 'bloco', this.char [0], '' ']: [1, 0,' nenhum ', this.char [1],' ''];
this.minbtn.status = set [0];
this.win.style.borderbottomwidth = set [1];
this.content.style.display = set [2];
this.minbtn.innerhtml = set [3]
this.minbtn.title = set [4];
this.win.style.top = this.gety (). top;
},
Fechar: function () {// 关闭
this.win.style.display = 'nenhum';
document.all.xhs1.stop ();
window.onscroll = null;
},
Setopacity: function (x) {// 设置透明度
var V = x> = 100? '': 'Alfa (opacidade =' + x + ')';
this.win.style.visibility = x <= 0? 'Hidden': 'Visible'; // isto 有绝对或相对定位内容不随父透明度变化的 bug
this.win.style.filter = v;
this.win.style.opacity = x / 100;
},
Mostrar: function () {// 渐显
ClearInterval (this.timer2);
var Me = this, fx = this.fx (0, 100, 0,1), t = 0;
this.timer2 = setInterval (function () {
t = fx ();
me.setOpacity (t [0]);
if (t [1] == 0) {ClearInterval (me.timer2)}
}, 6); // 10 a 6
},
FX: function (a, b, c) {// 缓冲计算
var cmath = matemática [(a - b)> 0? "Piso": "teto"], c = c || 0,1;
Return function () {return [a += cmath ((b - a) * c), a - b]}
},
gety: function () {// 计算移动坐标
var d = document, b = document.body, e = document.documentElement;
var s = Math.max (B.Scrolltop, E.Scrolltop);
var h = /backcompat/i.test(document.compatmode)? B.ClientHeight: E.ClientHeight;
var h2 = this.win.offsetHeight;
Retornar {pé: s + h + h2 + 2 + 'px', topo: s + h - h2 - 2 + 'px'}
},
moveto: function (y) {// 移动动画
ClearInterval (this.timer);
var Me = this, a = parseint (this.win.style.top) || 0;
var fx = this.fx (a, parseint (y));
var t = 0;
this.timer = setInterval (function () {
t = fx ();
me.win.style.top = t [0] + 'px';
if (t [1] == 0) {
ClearInterval (me.timer);
me.bind ();
}
}, 6); // 10 a 6
},
bind: function () {// 绑定窗口滚动条与大小变化事件
var Me = this, st, rt;
window.onscroll = function () {
ClearTimeout (ST);
ClearTimeout (me.timer2);
me.setOpacity (0);
st = setTimeout (function () {
me.win.style.top = me.gety (). top;
me.show ();
}, 100); // 600 MOD 100
};
window.onResize = function () {
ClearTimeout (RT);
rt = setTimeout (function () {me.win.style.top = me.gety (). top}, 100);
}
},
init: function () {// 创建 html
function $ (id) {return document.getElementById (id)};
this.win = $ ('msg_win');
var set = {minbtn: 'msg_min', closebtn: 'msg_close', título: 'msg_title', conteúdo: 'msg_content'};
para (var id em set) {this [id] = $ (set [id])};
var Me = this;
this.minbtn.OnClick = function () {me.set (); this.blur ()};
this.CloseBtn.OnClick = function () {me.close ()};
this.char = Navigator.UserAgent.TolowerCase (). Indexof ('Firefox') + 1? ['_', '::', '×']: ['0', '2', 'r']; // ff 不支持 webdings 字体
this.minbtn.innerhtml = this.char [0];
this.closebtn.innerhtml = this.char [2];
setTimeout (function () {// 初始化最先位置
me.win.style.display = 'bloco';
me.win.style.top = me.gety (). Foot;
me.moveto (me.gety (). top);
}, 0);
devolver isso;
}
};
Message.init ();
</script>