浏览器标题栏闪动

2013-8-13 liyangweb.com 李杨 JavaScript

当网页有新消息时,如何能引起用户的注意呢?

我们可以在浏览器的标题栏中来闪动提醒,这样即使当前页面在后台,用户也可以很只管的看到提示消息。

代码如下:

<meta charset="utf-8" />
<script type="text/javascript">
<!--
function BlinkTitle(title, timeout){
	var self = this;
	var timer = null;
	var backup = document.title;

	self.start = function(title, timeout){
		self.stop();

		if(title != undefined){
			self.title = title;
		}
		self.timeout = timeout == undefined? 600: timeout;

		function blink(){
			document.title = document.title == backup? self.title : backup;
		}
		blink();
		timer = setInterval(blink, self.timeout);
	}

	self.stop = function(){
		if(timer != null){
			document.title = backup;
			clearInterval(timer);
			timer = null;
		}
	}

	self.start(title, timeout);
}

var blink = new BlinkTitle('www.liyangweb.com');
//-->
</script>

<a onclick="blink.stop()">点此停止</a>

 

标签: JavaScript

评论:

arcadetogo
2019-01-21 08:38
<a href="http://www.tumblrwiz.com/phillies-1-richie-ashburn-whitered-strip-flexbase-authentic-collection-stitched-mlb-jersey-nfls">phillies 1 richie ashburn whitered strip flexbase authentic collection stitched mlb jersey</a> <a href="http://www.usafitno.com/dam%C3%A4nner-ralph-lauren-city-polo-rot-khaki-polox">dam盲nner ralph lauren city polo rot khaki</a> <a href="http://www.corewmi.com/mens-nike-new-york-jets-92-leonard-williams-elite-green-salute-to-service-nfl-jersey-nflz">mens nike new york jets 92 leonard williams elite green salute to service nfl jersey</a> <a href="http://www.faimark.com/nike-air-max-tailwind-5-kvinners-r%C3%B8d-gr%C3%B8nn-kurpesd">nike air max tailwind 5 kvinners r酶d gr酶nn</a> <a href="http://www.madamevelvet.com/blackhawks-29-bryan-bickell-purple-practice-stitched-nhl-jersey-nflz">blackhawks 29 bryan bickell purple practice stitched nhl jersey</a> <a href="http://www.moveinplace.com/air-jordan-retro-5-noir-violet-rose-obuve">air jordan retro 5 noir violet rose</a>
arcadetogo http://www.arcadetogo.com/
5kya44jr
2019-01-11 02:28
<a href="http://www.brng84c3.com/adidas-rose-or-noir-enfant-obuvd">adidas rose or noir enfant</a> <a href="http://www.svdnoaq1.com/air-jordan-super-fly-iv-wei%C3%9F-silber-butyd">air jordan super fly iv wei脽 silber</a> <a href="http://www.t1vyycje.com/nike-air-presto-4d-jaune-or-obuvc">nike air presto 4d jaune or</a> <a href="http://www.vcjmgh9f.com/nike-air-force-1-high-violet-marron-kurpesf">nike air force 1 high violet marron</a> <a href="http://www.x6dbypaf.com/kvinners-new-balance-990-kurpesa">kvinners new balance 990</a> <a href="http://www.a5ckyuq3.com/air-jordan-cp3-ix-verde-negro-chaussuresc">air jordan cp3 ix verde negro</a>
5kya44jr http://www.5kya44jr.com/
alusownia
2019-01-09 15:19
<a href="http://www.yuriboguinia.com/youth-golden-state-warriors-hat-hatr">youth golden state warriors hat</a> <a href="http://www.manamexports.com/university-of-arizona-hat-hatr">university of arizona hat</a> <a href="http://www.bgattis.com/nike-zoom-clear-out-2016-skou">nike zoom clear out 2016</a> <a href="http://www.asinagaojisan.com/hermes-collier-bracelet-hermesr">hermes collier bracelet</a> <a href="http://www.candaceart.com/parajumper-v%C3%A4st-parajumpersr">parajumper v盲st</a> <a href="http://www.ktfinans.com/coach-silver-crossbody-coachr">coach silver crossbody</a>
alusownia http://www.alusownia.com/
thegroceri
2019-01-07 07:12
<a href="http://www.rankfencing.com/kvinders-nike-lunarglide-6-lyser%C3%B8d-sort-kurpesc">kvinders nike lunarglide 6 lyser酶d sort</a> <a href="http://www.signalsvideo.com/mens-ralph-lauren-mesh-polo-navy-red-polow">mens ralph lauren mesh polo navy red</a> <a href="http://www.blainefxb.com/mennns-nike-free-3.0-svart-gull-butyf">mennns nike free 3.0 svart gull</a> <a href="http://www.cockaweek.com/ralph-lauren-navy-polo-men-t-shirt-with-logo-custom-regular-fit-polou">ralph lauren navy polo men t shirt with logo custom regular fit</a> <a href="http://www.elisajean.com/a-buon-mercato-nike-air-force-1-low-scarpe-chaussuresf">a buon mercato nike air force 1 low scarpe</a> <a href="http://www.naturabolt.com/asics-l%C3%B8b-sko-lyser%C3%B8d-hvid-scarpef">asics l酶b sko lyser酶d hvid</a>
thegroceri http://www.thegroceri.com/
boobseze
2019-01-04 14:50
<a href="http://www.cremontana.com/nike-lebron-14-prm-r%C3%B8d-carpet-january-2016-chaussuresa">nike lebron 14 prm r酶d carpet january 2016</a> <a href="http://www.holeninegolf.com/limited-dion-lewis-jersey-cleveland-browns-28-alternate-orange-nflf">limited dion lewis jersey cleveland browns 28 alternate orange</a> <a href="http://www.boobseze.com/free-run-flyknit-white-black-mens-runningg">free run flyknit white black mens</a> <a href="http://www.divyangshop.com/35-authentic-grant-hill-detroit-pistons-jersey-mens-adidas-nba-purple-throwback-1995-all-nflv">35 authentic grant hill detroit pistons jersey mens adidas nba purple throwback 1995 all</a> <a href="http://www.caveduperreux.com/nike-huarache-red-pure-trainersa">nike huarache red pure</a> <a href="http://www.fabloomsilk.com/air-jordan-retro-11-bianca-oro-rosso-scarped">air jordan retro 11 bianca oro rosso</a>
boobseze http://www.boobseze.com/
homebabyscan
2018-12-31 22:38
<a href="http://www.blackandjules.com/nike-air-presto-essential-femmes-fonctionnement-chaussures-schuhef">nike air presto essential femmes fonctionnement chaussures</a> <a href="http://www.codepuzzel.com/nike-air-max-95-university-r%C3%B8d-line-scarpef">nike air max 95 university r酶d line</a> <a href="http://www.cruisersdiner.com/nike-kd-7-kvinners-svart-gul-scarpeg">nike kd 7 kvinners svart gul</a> <a href="http://www.drminteriors.com/adidas-rose-773-ii-mennns-basketball-sko-goo-kurpesa">adidas rose 773 ii mennns basketball sko goo</a> <a href="http://www.equacart.com/nike-air-jordan-eclipse-hvid-line-schuhee">nike air jordan eclipse hvid line</a> <a href="http://www.garyfaulconer.com/femmes-air-jordan-retro-13-blanc-noir-kurpesc">femmes air jordan retro 13 blanc noir</a>
homebabyscan http://www.homebabyscan.com/
praiseti
2018-12-31 05:28
<a href="http://www.evolutionecig.com/jordan-1-svart-gull-patent-l%C3%A6r-schuheb">jordan 1 svart gull patent l忙r</a> <a href="http://www.georginabauer.com/76ers-3-allen-iverson-red-1964-throwback-stitched-nba-jersey-nflu">76ers 3 allen iverson red 1964 throwback stitched nba jersey</a> <a href="http://www.bootsoffprice.com/nike-mercurial-vapour-cr7-skou">nike mercurial vapour cr7</a> <a href="http://www.theprintjobs.com/black-yellow-mens-nike-free-run-7.0-shoes-runninge">black yellow mens nike free run 7.0 shoes</a> <a href="http://www.dbajournal.com/nike-dunk-sky-high-joli-nude-laser-wedge-sneakers-zapatosu">nike dunk sky high joli nude laser wedge sneakers</a> <a href="http://www.procomedian.com/femminile-nike-air-max-2017-oro-arancia-chaussuresa">femminile nike air max 2017 oro arancia</a>
praiseti http://www.praiseti.com/
shanamorgan
2018-12-30 17:17
<a href="http://www.albainmaz.com/blue-black-mens-nike-hypervenom-shoes-runninge">blue black mens nike hypervenom shoes</a> <a href="http://www.seemyvcard.com/adidas-neo-skate-gris-naranja-schuhea">adidas neo skate gris naranja</a> <a href="http://www.joegauntlett.com/air-jordan-retro-11-lilla-r%C3%B8d-scarpeb">air jordan retro 11 lilla r酶d</a> <a href="http://www.rpnailsalon.com/nike-air-max-95-green-spain-shoeso">nike air max 95 green spain</a> <a href="http://www.hrubinlaser.com/nike-free-run-3-corail-rosa-kurpesb">nike free run 3 corail rosa</a> <a href="http://www.pruvitallday.com/nike-lunar-terra-arktos-volt-zapatost">nike lunar terra arktos volt</a>
[url=http://www.shanamorgan.com/]shanamorgan[/url]
www
2013-08-13 20:36
靠有广告了;牛逼
liyangweb.com 李杨
2013-08-13 20:45
@www:(*^__^*)域名钱不知道猴年马月才能赚回来~~~

发表评论:

Powered by emlog 冀ICP备13011830号-1