<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, 'block', this.char[0], 'minimize'] : [1, 0, 'none', this.char[1], 'restore']; .minbtn.status = set[0]; <br>this.win.style.borderBottomWidth = set[1]; <br>this.content.style.display = set[2] <br>this.minbtn .innerHTML = set[3] <br>this.minbtn.title = set[4]; <br>this.win.style.top = this.getY().top; <br>}, <br>close: 함수( ) {//닫기<br>this.win.style.display = 'none'; <br>document.all.xhs1.stop(); <br>window.onscroll = <br>}, <br> setOpacity: function (x) {//투명도 설정 <br>var v = x >= 100 ? '' : 'Alpha(opacity=' x ')' <br>this.win.style.visibility = x < ;= 0 ? 'hidden' : 'visible'; //IE에는 상위 투명도에 따라 절대 또는 상대 위치 지정 내용이 변경되지 않는 버그가 있습니다. <br>this.win.style.filter = <br>this.win; .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 || 0.1>return function () { return [a = cMath (( b - a) * c), a - b] } <br>}, <br>getY: function () {//이동 좌표 계산<br>var d = document, b = document.body, e = document.documentElement; <br>var s = Math.max(b.scrollTop, e.scrollTop); <br>var h = /BackCompat/i.test(document.compatMode) ? b.clientHeight; <br> var h2 = this.win.offsetHeight; <br>return { foot: s h h2 2 'px', top: s h - h2 - 2 'px' } <br>}, <br>moveTo: 함수(y ) {/ /애니메이션 이동 <br>clearInterval(this.timer); <br>var me = this, a =parseInt(this.win.style.top) || 0<br>var fx = this.fx( a, parsInt (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>me.bind() <br>}, 6 ); / /10 ~ 6 <br>}, <br>bind: function () {//창 스크롤 막대 및 크기 변경 이벤트 바인딩<br>var me = this, st, rt <br>window.onscroll; function ( ) { <br>clearTimeout(st); <br>clearTimeout(me.timer2); <br>me.setOpacity(0) <br>st = setTimeout() { <br>me.win. style.top = me.getY().top; <br>me.show(); <br>}, 100) //600 mod 100 <br>window.onresize = function() <br>clearTimeout(rt); <br>rt = setTimeout(function () { me.win.style.top = me.getY().top }, 100) <br>} <br>}, <br>init : function () {//HTML 생성 <br>function $(id) { return document.getElementById(id) } <br>this.win = $('msg_win') <br>var set = { minbtn: 'msg_min', closebtn: 'msg_close', title: 'msg_title', content: '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는 웹딩 글꼴을 지원하지 않습니다. <br>this.minbtn.innerHTML = this.char[0] <br>this.closebtn.innerHTML = this.char[2]; (함수( ) {//첫번째 위치 초기화 <br>me.win.style.display = 'block'; <br>me.win.style.top = me.getY().foot; <br>me. moveTo(me .getY().top); <br>return this <br>} <br>} <br></script> ; <br><br> </div>