时间:2021-07-01 10:21:17 帮助过:45人阅读
<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('12345');
//-->
</script>
<a onclick="blink.stop()">stop</a>