In diesem Artikel wird beschrieben, wie JS den Effekt der Implementierung von Webseiten -Titeln implementiert, wenn Nachrichten erfolgen. Teilen Sie es für Ihre Referenz wie folgt weiter:
<html xmlns = "http://www.w3.org/1999/xhtml"> <head runat = "server"> <title> unt tites page </title> <cript> var g_blinkid = 0; var g_blinkswitch = var g_blinktitle = document. null; var g_newmsg_sound = null; var g_app_num = 0; var g_appnum = 0; var g_bappmore = false; var g_inputtime = 0; "【】 -" + g_blinktitle: "【New News】 -" + g_blinktitle; g_blinkswitch ++;} g_blinkid = setInterval (blinknewmsg, 1000); Funktion stopblinknewmsg () {if (g_blinkid) {clearInterval (g_blinkid); g_blinkid = 0; document.title = g_blinktitle; }} </script> </head> <body> <form ID = "Form1" runat = "server"> <div> <input id = "button1" type = "button" value = "button" onclick = "stopblinknewmsg ();"; /> </div> </form> </body> </html>Siehe Head-26.js von Kaixin.com
var g_blinkid = 0; var g_blinkswitch = 0; var g_blinktitle = document.title; var g_onlineUser = ""; var g_sysmsg_sound = null; var g_newmsg_sound = null; var g_app_num = 0; var g_appnum = 0; blinknewmsg () {var now = new Date (); var now = now.getTime (); if (nuntime - g_inputtime> 5000) {document.title = g_blinkswitch % 2? "【】 -" + g_blinktitle: "【New News】 -" + g_blinktitle; } G_BLINKSWITCH ++;} Funktion BlinKOnline () {document.title = g_blinkswitch % 2? "○" + g_onlineUser + "ist online-" + g_blinktitle: "●" + g_onlineUser + "ist online-" + g_blinktitle; G_BLINKSWITCH ++; if (g_blinkswitch> 10) {stopblinknewmsg (); }} Funktion checknewmsg () {var url = "/home/newmsg.php"; var pars = ""; var myajax = new ajax.request (url, {methode: "post", parameter: pars, onComplete: function (req) {{achnewmsgshow (req);}}); g_blinkid = 0; $ ("head_msgdiv"). style.display = "keine"; document.title = g_blinktitle; }} var g_oldmsg = g_oldsysmsg = g_oldbbs = g_oldbbsReply = g_oldCommention = g_oldReply = 0; Funktion checknewmsgshow (req) {var r = req.responSeText; stoPblinknewmsg (); setTimeout (checknewmsg, 60000); eval ("r ="+r); var a_msglist = new Array ("msg", "sysmsg", "bbsreeply", "Kommentar", "Antwort"); if (r.notice == "1") {var boundbound = parseInt (r.forbidSound); if (! verboten) {für (i = 0; i <a_msglist.length; i ++) {if ($ ("body_" + a_msglist [i] + "_num")) {var c = parseInt ($ ("body_" + a_msglist [i] + "_num"). Innerhtm); eval ("g_old" + a_msglist [i] + "= c;"); }} var newmsg = parseInt (r.msg) + parseInt (r.bbs) + parseInt (r.bbsReply) + parseInt (r.comment) + parseInt (R.Reply); var sysmsg = parseInt (R.Sysmsg); var NewChange = (ParseInt (R.MSG) - G_OLDMSG) || (ParseInt (R.BBS) - G_oldbbs) || (ParseInt (r.bbsReply) - g_oldbbsreply) || (ParseInt (r.comment) - g_oldComent) || (ParseInt (r.Reply) - g_oldreply); var für (i = 0; i <a_msglist.length; i ++) {eval ("g_old" + a_msglist [i] + "= parseInt (r." + a_msglist [i] + ");"); } if (newmsg && newchange) { if (g_newmsg_sound == null) { g_newmsg_sound = new SWFObject("http://img.kaixin001.com.cn/i2/newmsg_sound.1.0.swf", "newmsg_sound_swf", "1", "1", "8", "#ffffff", wahr); g_newmsg_sound.addParam ("erlaubt", "immer"); g_newmsg_sound.addparam ("wmode", "undurchsichtig"); g_newmsg_sound.addparam ("Menü", "false"); g_newmsg_sound.addvariable ("autoplay", "0"); } g_newmsg_sound.write ("head_msgSound_div"); } else if (sysmsg && sysschange) {if (g_sysmsg_sound == null) {g_sysmsg_sound = new swfObject ("http://img.kaixin001.com.cn/i2/sysmsg_sound.1.0.0.Swf", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", ",", " "#ffffff", wahr); g_sysmsg_sound.addParam ("erlaubt", "immer"); g_sysmsg_sound.addparam ("WMODE", "undurchsichtig"); g_sysmsg_sound.addparam ("Menü", "false"); g_sysmsg_sound.addvariable ("autoplay", "0"); } g_sysmsg_sound.write ("head_msgSound_div"); }} $ ("head_msgdiv"). style.display = "block"; g_blinkid = setInterval (blinknewmsg, 1000); } else if (0 && r.online.length) {g_blinkswitch = 0; g_onlineUser = r.online; g_blinkid = setInterval (BlinKonline, 500); } für (i = 0; i <a_msglist.length; i ++) {if (! parseInt (r [a_msglist [i]])) {$ ("head_" + a_msglist [i] + "_num"). InnerHtml = ""; if ($ ("body_" + a_msglist [i] + "_num")) {$ ("body_" + a_msglist [i] + "_num"). className = "ql2"; $ ("body_" + a_msglist [i] + "_num"). Innerhtml = "0 neue Elemente"; }} else {$ ("head_" + a_msglist [i] + "_num"). innerHtml = "(" + r [a_msglist [i]] + "); if ($ ("body_" + a_msglist [i] + "_num")) {$ ("body_" + a_msglist [i] + "_num"). className = "cr"; $ ("body_" + a_msglist [i] + "_num"). Innerhtml = r [a_msglist [i]] + "neu"; } if (a_msglist [i] == "msg") {if ('function' == typeof (msg_view_checknewmsg)) {msg_view_checknewmsg (); }; }}}} function outputhead () {var v_html = '<div id = "head">'+'<div>'+'<div style = "margin-top: 3px;">'+'<div style = "padding-left: 18px;" src = "http://img.kaixin001.com.cn/i2/kaixinLogo.gif"/> </a> </div> '+' <div> '+' <div id = "hn1"> '+' <div> <a href = "/homes/homes/t = '+math.ce (math.cil (math.ceL () (math.ceil () (math.ceil () (math.ceil () (math.ceil () (math.ce '"> Home </a> </div>'+'<div> <a href =" javaScript: xs (1); <div> <a href = "/home/"> Meine Homepage </a> </div> '+' <div> <a href = "/home/"> Meine Homepage </a> </div> '+' <div> Meine Homepage Vorschau: </div> '+' <div> '+' <a href = home/home/_ _ _ _ _ _ _ _ _ _ _ _ _ _ onclick = "JavaScript: hy ();"> '+' <div> style = "margin: 5px 3px;"> <img src = "http://img.kaixin001.com.cn/i/small-tri.gif"/> </> </divin '+'+'<div style = "cursor: poiner;" <div> </div> '+' </a> '+' </div> '+' <div> '+' <a href = "/home/? _ preview = other" target = _blank onclick = "javaScript: hy ();"; > '+' <div style = "margin: 5px 3px;"> <img src = "http://img.kaixin001.com.cn/i/small-tri.gif"/> </div> '+' <div style = "cursor: pointer; </div> '+' </div> '+' </div> '+' <div id = "hn_xx1"> <img src = "http://img.kaixin001.com.cn/i/r_xx13.gif"/> </div> '+'+'+' TV2 ". Math.ceil (math.random () * 100)+'"> Freunde </a> </div>'+'<div> <a href =" javaScript: xs (2); <!-'+' <iframe style = "Position: absolut; Z-Index: 1; Breite: Ausdruck (this.nextsibling.offsetwidth); Höhe: Ausdruck (this.Nextsibling.offseteight); Top: Ausdruck (this.nextsibling.offsettop); Framborder = "0">/iframe> '+'-> '+' <div id = "hn2_l" style = "z-Index: 2"> '+' <div> <a href = "/friend/"> my Friends </a> </div> '+' <div> <a href = "/friendType/friendType = online = online". href = "/Freund/Gruppe.php"> Freundesmanagement </a> </div> '+' <div> <a href = "/home/fstatus.php"> Freundstatus -Update </a> </div> '+' <div> <a href = "/friend/invite.php"> Einladung Friends, </a> </div> '+'+'+'+'+'+'+'+'+'+'+'+'+'+'+'+'<A. href = "/friend/search.php"> find friends </a> </div> '+' </div> '+' <div> <a href = "/friend/search.php"> find friends src = "http://img.kaixin001.com.cn/i/r_xx13.gif"/> </div> '+'+'<div id = "hn3">'+'<div> <a href = "/Gruppe/T ='+math.ce.ceil (math.random () * 100)+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+". href="javascript:xs(3);"><img src="http://img.kaixin001.com.cn/i/r_sj.gif" /></a></div>'+' <div></div>'+' <div id="hn3_l">'+' <div><a href="/group/">My Gruppe </a> </div> '+' <div> <a href = "/gruppe/flist.php"> Freunde </a> </div> '+' <div> <a href = "/gruppe/new.php"> Erstellen Sie eine neue Gruppe </a> </div> '+' <a href = "/gruppe"/gruppe/suche.php "; <div id = "hn_xx3"> <img src = "http://img.kaixin001.com.cn/i/r_xx13.gif"/> </div> '+' '+' <div id = "hn_xx3"> <img /> </div> '+' '+' <div id = "hn4" style = "padding-right: 28px;"> '+' <div> <a href = "/msg/? t = '+math.ceil (math.random () * 100)+'"> message </a> </div> <div> <a.href = href = href src = "http://img.kaixin001.com.cn/i/r_sj.gif"/> </a> <span style = "Position: absolut; obere: 5px; links: 65px; Anzeige: None; id = head_msgdiv> <a href = "/msg/" style = "margin-top: -5px;"> <img src = "http://img.kaixin001.com.cn/i/ddtx.gif" onmouseover = "javascript: xs (4);"; Border = 0> </a> </span> </div> '+' <div> </div> '+' <div id = "hn4_l"> '+' <div> <a href = "/msg/conbox.php? t = '+math.ceil (math.random () * 100)+'"> "> Short Message <span-style =" padding-style = "padding-style =" padding-style = "padding-style =" padding-style = "padding-style =" padding-style ". id = head_msg_num> </span> </a> </div> ' +' <div> <a href = "/msg/sys.php? t = ' + math.ceil (math.random () * 100) +'" "> Systemmeldung <span style =" padding-lft: 2Px; <div> <a href = "/comment/? t = ' + math.ceil (math.random () * 100) +'"> comment <span style = "padding-links: 2px; color: rot;" 100) + '"> Kommentar Antwort <span style =" padding-links: 2px; color: rot; "id = head_reply_num> </span> </a> </div>' + '<div> <a href ="/comment/uindex.php? style = "padding-links: 2px; color: rot;" id = head_bbs_num> </span> </a> </div> ' +' <div> <a href = "/comment/usend.php? t = ' + math.ceil (math.random () * 100) +' + ' id = head_bbsReply_num> </span> </a> </div> '+' </div> '+' <div> <a href = "/Freund/invite.php"> Einladung </a> ┊ <a href = "/friend/search.php"> suche jemanden </a> ┊ <a href = "/set/account.php"> account </a> ┊ <a href = "/set/account.php"> account; href="/set/privacy.php">Privacy</a> ┊ <a href="/login/logout.php">Exit</a></div>'+' <div></div>'+' </div>'+' <div></div>'+' <div></div>'+' <div></div>'+' <div></div>'+' <div> </div> '+' <div> </div> '+' <div> </div> '+' <div> '+' <div> </div> '+' <div> '+' <div> </div> '+' <div> '+' <Viv> style = "z-Index: 20000; Position: Absolut; Hintergrund: #ffff; Grenze: 2px Solid #f7f7f7; Breite: 160px; Höhe: 250px; Anzeige: Keine;"> '+' </div> '; v_index_num) {if (-1 == v_link.indexof ("?")) {v_link + = "? T =" + math.ceil (math.random () * 100); 12px 15px; "onmouseover =" JavaScript: if (/'' + v_index_num + '/' ==/'1/') {$ (/'app_friend_' + v_aid + '/'/'.Style.display=/'Block/ '; '/').Style.Display=/'none/'iade>' '<div> <img src = "' + v_icon + '" "Align =" Abmiddle "/> <a href ="' + v_link + '" style = "Anzeige: Keine; Padding: 8px 3px; Cursor: Zeiger;" src = "http://img.kaixin001.com.cn/i2/xiasanjiao.gif" Align = "Abmiddle"/> </div> '+' <div> </div> '+' </div> '; document.WriteLN (_outputApp (v_icon, v_link, v_title, v_aid, v_index_num); return '<span id = applistmore style = "display: keine">'; id = applistscroll style = "margin-top: -10px;"> <img src = "http://img.kaixin001.com.cn/i2/xiala.gif" Align = "Absmiddle"> <a href = "javaScript: showappmore (); '';} Funktion setApplistHidDentail () {document.writeln (_setApplistHidDentail ()); <div id = "install_tips" style = "Position: absolut; links: 110px; top: -7px; z-Index: 99; Anzeige: Keine;"> <div style = "padding: 7px 15px 0 0;"> <img src = "http://img.kaixin001.com onclick = "h (/'install_tips/')"/> </div> <p style = "padding: 0px 20px;"> Klicken Sie hier, um verschiedene praktische oder Spielkomponenten hinzuzufügen. href = "/app/list.php"> Komponente hinzufügen </a> </div> </div> <div-style = "margin-top: -8px;"> <img src = "http://img.kaixin001.com.cn/i/index_app_set1.gif"/> <a href = "/set/app"/> <a Einstellungen </a> </div> </div> ');} function showappmore () {if ($ ("applistmore") src = "http://img.kaixin001.com.cn/i2/shouqi.gif" Align = "Abmiddle"> <a href = "javascript: showappmore (); $ ("ApplistsCroll"). InnerHtml = '<img src = "http://img.kaixin001.com.cn/i2/xiala.gif" Align = "Abmiddle"> <a href = "javaScript: showappmore (); outputAppInfo () {if (g_allapp_num> g_prevapp_num) {var url = "/app/left.php"; }); _outputApp (Daten [i] ["Symbol"], Daten [i] ["Link"], Daten [i] ["title"], Daten [i] ["Aid"], Daten [i] ["index_num"]); outputTail(){ document.writeln('<div></div>'+'</div>'+'<div id="b">'+' <div><a href="/s/about.html" target="_blank">About us</a><span>┊</span><a href="/s/contact.html" target="_blank">Contact Informationen </a> <span> ┊ </span> <a href = "/t/feedback.html" target = "_ leer"> Feedback </a> <span> ┊ </span> <a href = "/s/help.htmL" target = "_ bloße"> Help Center </a> © 2009 kaixin001.com <a class = c6 href = http: //www.miiibeian.gov.cn target = _blank> peking ICP Zertifikat Nr. 080482 </a> </div> '+' </div> ');}For more information about JavaScript related content, please check out the topics of this site: "Summary of ajax operation skills in JavaScript", "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation special effects and techniques", "Summary of JavaScript errors and debugging skills", "Summary of JavaScript data structures and Algorithmusfähigkeiten "," Zusammenfassung von JavaScript -Traversal -Algorithmen und -Techniken "und" Zusammenfassung der Verwendung von JavaScript mathematischer Operationen ""
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.