复制代码代码如下:
<!-开始->
<style type = "text/css">
#MSG_WIN {ตำแหน่ง: Absolute; ขวา: 0PX; แสดง: None; Overflow: Hidden; Z-Index: 99; Border: 1px Solid #C00; พื้นหลัง: #f9effc; Width: 210px; Font-Size: 12px;
#MSG_WIN .ICOS {ตำแหน่ง: Absolute; TOP: 2PX;*TOP: 0PX; ขวา: 2PX; Z-INDEX: 9;}
.icos a {float: ซ้าย; สี: #ffffff; มาร์จิ้น: 1px; text-allign: center; font-weight: bold; ความกว้าง: 14px; ความสูง: 22px; สายไฟ: 22px; padding: 1px;
.icos A: โฮเวอร์ {สี:#ffcc00;}
#MSG_TITLE {พื้นหลัง: #FA6705; ขอบด้านล่าง: 1PX SOLID #710B97; Border-Top: 1PX Solid #FFF; Border-Fleft: 1PX Solid #FFF; สี: #FFFFFF; ความสูง: 25PX;
#MSG_CONTENT {มาร์จิ้น: 1px; มาร์จิ้น-ขวา: 0; ความกว้าง: 210px; ความสูง: 160px; ล้น: ซ่อน; TEXT-ALIGING: CENTER}
</style>
<!-结束->
<div id = "msg_win" style = "จอแสดงผล: block; top: 503px; การมองเห็น: มองเห็น; ความทึบ: 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 = "movie" value = "flvplayer.swf? vcastr_file = userlogin/video/qlg.flv & isautoplay = 1"/>
<param name = "คุณภาพ" value = "สูง"/>
<param name = "lewalfullscreen" value = "true" />>
<ฝัง src = "flvplayer.swf? vcastr_file = userlogin/video/qlg.flv & isautoplay = 1" nowlfullscreen = "true" คุณภาพ = "สูง"
pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "แอปพลิเคชัน/x-shockwave-flash"> </embed>
</ject>
</div>
</div>
<script type = "text/javascript">
var message = {
SET: function () {// 最小化与恢复状态切换
var set = this.minbtn.status == 1? [0, 1, 'block', this.char [0], '最小化']: [1, 0, 'none', 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 (). ด้านบน;
-
ปิด: ฟังก์ชัน () {// 关闭
this.win.style.display = 'ไม่มี';
document.all.xhs1.stop ();
window.onscroll = null;
-
SetOpacity: function (x) {// 设置透明度
var v = x> = 100? '': 'alpha (opacity =' + x + ')';
this.win.style.visibility = x <= 0? 'ซ่อน': 'มองเห็นได้'; // คือ有绝对或相对定位内容不随父透明度变化的บั๊ก
this.win.style.filter = v;
this.win.style.Opacity = x / 100;
-
แสดง: 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: ฟังก์ชั่น (a, b, c) {// 缓冲计算
var cmath = math [(a - b)> 0? "ชั้น": "เพดาน"], c = c || 0.1;
return function () {return [a += cmath ((b - a) * c), a - b]}
-
gety: function () {// 计算移动坐标
var d = เอกสาร, 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 {foot: s + h + h2 + 2 + 'px', top: s + h - h2 - 2 + 'px'}
-
Moveto: ฟังก์ชั่น (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';
ถ้า (t [1] == 0) {
ClearInterval (me.timer);
me.bind ();
-
}, 6); // 10 ถึง 6
-
ผูก: ฟังก์ชัน () {// 绑定窗口滚动条与大小变化事件
var me = this, st, rt;
window.onscroll = function () {
ClearTimeout (ST);
ClearTimeout (me.timer2);
me.setOpacity (0);
st = settimeout (ฟังก์ชัน () {
me.win.style.top = me.gety (). ด้านบน;
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
ฟังก์ชั่น $ (id) {return document.getElementById (id)};
this.win = $ ('msg_win');
var set = {minbtn: 'msg_min', closebtn: 'msg_close', ชื่อเรื่อง: 'msg_title', เนื้อหา: 'msg_content'};
สำหรับ (var id in set) {นี้ [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 = 'block';
me.win.style.top = me.gety (). เท้า;
me.moveto (me.gety (). ด้านบน);
}, 0);
คืนสิ่งนี้;
-
-
message.init ();
</script>