<div class="codetitle"> <span><a style="CURSOR: pointer" data="2042" class="copybut" id="copybut2042" onclick="doCopy('code2042')"><u>Copier le code</u></a></span> Le code est le suivant :</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 () {//Réduire et restaurer le changement d'état<br>var set = this.minbtn. == 1 ? [0, 1, 'block', this.char[0], 'minimize'] : [1, 0, 'none', this.char[1], 'restore'] <br>this; .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 ( ) {//Fermer<br>this.win.style.display = 'none'; <br>document.all.xhs1.stop(); <br>window.onscroll = <br>}, <br> setOpacity : function (x) {//Définir la transparence <br>var v = x >= 100 ' : 'Alpha(opacity=' x ')'; ;= 0 ? 'hidden' : 'visible'; //IE a un bug où le contenu de positionnement absolu ou relatif ne change pas avec la transparence parent <br>this.win.style.filter = v <br>this.win; .style .opacity = x / 100; <br>}, <br>show: function () {//Fade in <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) { // Calcul du tampon<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 () {//Calculer les coordonnées de déplacement<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) ? <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 ) {//Déplacer l'animation <br>clearInterval(this.timer); <br>var me = this, a = parseInt(this.win.style.top) || 0; 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>me.bind(); ); / /10 à 6 <br>}, <br>bind: function () {//Lier la barre de défilement de la fenêtre et l'événement de changement de taille<br>var me = this, st, rt <br>window.onscroll = function ( ) { <br>clearTimeout(st); <br>clearTimeout(me.timer2); <br>me.setOpacity(0); <br>st = setTimeout(function () { <br>me.win. style.top = me.getY().top; <br>me.show(); <br>}, 100 //600 <br>}; <br>clearTimeout(rt); <br>rt = setTimeout(function () { me.win.style.top = me.getY().top }, <br>} <br>}, init : function () {//Créer du HTML <br>function $(id) { return document.getElementById(id) }; <br>this.win = $('msg_win'); <br>var set = { minbtn : 'msg_min', closebtn : 'msg_close', titre : 'msg_title', contenu : '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.char = navigator.userAgent.toLowerCase().indexOf('firefox') 1 ['_', '::', '×'] : ['0', '2' , 'r']; //FF ne prend pas en charge les polices webdings <br>this.minbtn.innerHTML = this.char[0] <br>this.closebtn.innerHTML = this.char[2]; (function ( ) {//Initialisez la première position <br>me.win.style.display = 'block'; <br>me.win.style.top = me.getY().foot; <br>me. moveTo(me .getY().top); <br>}, 0); <br>retourne ceci <br>} <br>Message.init(); ; <br><br> </div>