<div class="codetitle"> <span><a style="CURSOR: pointer" data="2042" class="copybut" id="copybut2042" onclick="doCopy('code2042')"><u>コードをコピー</u></a></span> コードは次のとおりです:</div> <div class="codebody" id="code2042"> <br><!--开始--> <br><style type="text/css"> <br>#msg_win{position:absolute;right:0px;display:none;overflow:hidden;z-index:99;border:1px solid #c00;background:#F9EFFC;width:210px;font-size:12px;margin:0px;} <br>#msg_win .icos{position:absolute;top:2px;*top:0px;right:2px;z-index:9;} <br>.icos a{float:left;color:#FFFFFF;margin:1px;text-align:center;font-weight:bold;width:14px;height:22px;line-height:22px;padding:1px;text-decoration:none;font-family:webdings;} <br>.icos a:hover{color:#FFCC00;} <br>#msg_title{background:#FA6705;border-bottom:1px solid #710B97;border-top:1px solid #FFF;border-left:1px solid #FFF;color:#FFFFFF;height:25px;line-height:25px;text-indent:5px;font-weight:bold;} <br>#msg_content{margin:1px;margin-right:0;width:210px;height:160px;overflow:hidden; text-align:center} <br></style> <br><!--结束--> <br><br><div id="msg_win" style="display:block;top:503px;visibility:visible;opacity:1;"> <br><div class="icos"><a id="msg_min" title="最小化" href="javascript:void 0">_</a><a id="msg_close" title="关闭" href="javascript:void 0">×</a></div> <br><div id="msg_title">标题 <br></div> <br><div id="msg_content"> <br><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" <BR>codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="210" height="160"> <br><param name="movie" value="flvplayer.swf?vcastr_file=userlogin/video/qlg.flv&IsAutoPlay=1"/> <br><param name="quality" value="high"/> <br><param name="allowFullScreen" value="true" /> <br><embed src="flvplayer.swf?vcastr_file=userlogin/video/qlg.flv&IsAutoPlay=1" allowFullScreen="true" quality="high" <BR>pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="210" height="160"></embed> <br></object> <br></div> <br></div> <br><script type="text/javascript"> <br>var Message = { <br>set: function () {//状態切り替えを最小化して復元します<br>var set = this.minbtn。 == 1 ? [0, 1, 'ブロック', this.char[0], '最小化'] : [1, 0, 'なし', this.char[1], '復元']; .minbtn.status = set[0]; <br>this.win.style.borderBottomWidth = set[1]; <br>this.content.style.display = set[2]; = set[3] <br>this.minbtn.title = set[4]; <br>this.win.style.top = this.getY().top; <br>}, <br>close: function ( ) {//閉じる<br>this.win.style.display = 'none'<br>document.all.xhs1.stop(); <br>window.onscroll = null; setOpacity: function (x) {//透明度を設定します <br>var v = x >= 100 ? '' : 'Alpha(opacity=' x ')'; <br>this.win.style.visibility = x < ;= 0 ? 'hidden' : 'visible'; //IE には、親の透明度によってコンテンツの絶対位置または相対位置が変化しないというバグがあります。 .style .opacity = x / 100; <br>}, <br>show: function () {//フェードイン <br>clearInterval(this.timer2); <br>var me = this, fx = this.fx (0 , 100, 0.1), t = 0; <br>this.timer2 = setInterval(function () { <br>t = fx(); <br>me.setOpacity(t[0]); <br> if ( t[1] == 0) { clearInterval(me.timer2) } <br>}, 6); //10 ~ 6 <br>}, <br>fx: function (a, b, c) { // バッファ計算<br>var cMath = Math[(a - b) > 0 ? "floor" : "ceil"], c = c || return function () { return [a = cMath; (( b - a) * c), a - b] } <br>}, <br>getY: function () {//移動座標を計算<br>var d = document, b = document.body, e = documentElement; <br>var s = Math.max(b.scrollTop, e.scrollTop); <br>var h = /BackCompat/i.test(document.compatMode); <br> var h2 = this.win.offsetHeight; <br>return { foot: s h h2 2 'px', top: s h - h2 - 2 'px' } <br>}, <br>moveTo: function (y ) {/ /アニメーションを移動 <br>clearInterval(this.timer); <br>var me = this, a = parseInt(this.win.style.top) || <br>var fx = this.fx( a, parseInt (y)); <br>var t = 0; <br>this.timer = setInterval(function () { <br>t = fx(); <br>me.win.style.top = t [0] 'px'; <br>if (t[1] == 0) { <br>clearInterval(me.timer) <br>} <br>}; ); / /10 ~ 6 <br>}, <br>bind: function () {//ウィンドウのスクロール バーとサイズ変更をバインドします。event<br>var me = this, st, rt <br>window.onscroll = function ( ) { <br>clearTimeout(me.timer2); <br>st = setTimeout(function () { <br>me.win. style.top = me.getY().top; <br>me.show(); 100); //600 mod 100 <br>}; <br>clearTimeout(rt); <br>rt = setTimeout(function () { me.win.style.top = me.getY().top }, 100); >init : function () {//HTML の作成 <br>function $(id) { return document.getElementById(id) }; <br>this.win = $('msg_win'); <br>var set = { minbtn: 'msg_min'、closebtn: 'msg_close'、タイトル: 'msg_title'、コンテンツ: 'msg_content' }; <br>for (var Id in set) { this[Id] = $(set[Id]) }; <br>var me = this; <br>this.minbtn.onclick = function () { me.set(); this.blur() }; <br>this.closebtn.onclick = function () { me.close () }; <br>this.char = navigator.userAgent.toLowerCase().indexOf('firefox') 1 ? ['_', '::', '×'] : ['0', '2' , ' r']; //FF は Webding フォントをサポートしていません <br>this.minbtn.innerHTML = this.char[0]; <br>this.closebtn.innerHTML = this.char[2]; (function ( ) {//最初の位置を初期化します <br>me.win.style.display = 'block'; <br>me.win.style.top = me.getY().foot; <br>me. moveTo(me .getY().top); <br>return this; <br></script> ;<br><br> </div>