复制代码代码如下:
<! - 开始 ->
<style type = "text / css">
#msg_win {position: Absolute; droite: 0px; affichage: aucun; overflow: Hidden; z-index: 99; bordure: 1px solide # c00; arrière-plan: # f9effc; width: 210px; font-size: 12px; margin: 0px;}
#msg_win .icos {position: absolu; en haut: 2px; * en haut: 0px; à droite: 2px; z-index: 9;}
.icos a {float: gauche; couleur: #ffffff; marge: 1px; text-adign: Centre; Font-Weight: Bold; largeur: 14px; hauteur: 22px; line-height: 22px; padding: 1px; text-décoration: Aucun; Font-Family: webdings;};
.icos A: Hover {Color: # ffcc00;}
#msg_title {Background: # FA6705; Border-Bottom: 1Px Solid # 710B97; Border-Top: 1PX solide #fff; border-left: 1px solide #fff; couleur: #ffffff; hauteur: 25px; Bold;}
#msg_content {margin: 1px; margin-droite: 0; largeur: 210px; hauteur: 160px; overflow: Hidden; Texte-aligne: Centre}
</ style>
<! - 结束 ->
<div id = "msg_win" style = "affichage: bloc; top: 503px; visibilité: visible; opacité: 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 = "film" value = "flvplayer.swf? vCastr_file = userLogin / video / qlg.flv & isautoplay = 1" />
<param name = "qualité" value = "high" />
<param name = "allowfullScreen" value = "true" />
<embed src = "flvplayer.swf? vCastr_file = userLogin / video / qlg.flv & isautoplay = 1" allowfullScreen = "true" Quality = "high"
pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "application / x-shockwave-flash"> </ embed>
</ objet>
</div>
</div>
<script type = "text / javascript">
var message = {
set: function () {// 最小化与恢复状态切换
var set = this.minbtn.status == 1? [0, 1, 'Block', this.char [0], '最小化']: [1, 0, 'Aucun', 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;
},
Close: function () {// 关闭
this.win.style.display = 'Aucun';
document.all.xhs1.stop ();
window.onscroll = null;
},
setOpacity: function (x) {// 设置透明度
var v = x> = 100? '': 'Alpha (opacity =' + x + ')';
this.win.style.visibilité = x <= 0? «caché»: «visible»; // c'est-à-dire un bug
this.win.style.filter = v;
this.win.style.opacity = x / 100;
},
show: 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 à 6
},
fx: fonction (a, b, c) {// 缓冲计算
var cmath = math [(a - b)> 0? "plancher": "ceil"], 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;
return {pied: s + h + h2 + 2 + 'px', top: s + h - h2 - 2 + 'px'}
},
MOVETO: fonction (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 à 6
},
bind: function () {// 绑定窗口滚动条与大小变化事件
var me = ceci, 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
fonction $ (id) {return document.getElementById (id)};
this.win = $ ('msg_win');
var set = {minbtn: 'msg_min', closebtn: 'msg_close', title: 'msg_title', contenu: 'msg_content'};
pour (var id dans set) {this [id] = $ (set [id])};
var me = ceci;
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 = 'bloc';
me.win.style.top = me.gety ().
me.moveto (me.gety (). en haut);
}, 0);
retourner ceci;
}
};
Message.init ();
</cript>