当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 4

LukeZhang / wss
暂停

forked from 小老虎 / wss
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
flash.php 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
陈学虎 提交于 2016-04-23 19:26 . 1.3.2版本提交
<?php
//$num = mt_rand(1,2);
$num = 2;
if($num == 1) {
echo json_encode(array('title' => "【闪动标题1】",'ddd'=>$num));
}else{
echo json_encode(array('title' => "【 】",'ddd'=>$num));
}
?>
<script type="text/javascript">
;(function($) {
$.extend({
/**
*/
blinkTitle : {
show : function() { //有新消息时在title处闪烁提示
var step=0, _title = document.title;
var timer = setInterval(function() {
step++;
if (step==3) {step=1};
if (step==1) {document.title='<?php echo $multilingual_newmessage1;?>'+_title};
if (step==2) {document.title='<?php echo $multilingual_newmessage2;?>'+_title};
}, 500);
return [timer, _title];
},
/**
*/
clear : function(timerArr) { //去除闪烁提示,恢复初始title文本
if(timerArr) {
clearInterval(timerArr[0]);
document.title = timerArr[1];
};
}
}
});
})(jQuery);
//
jQuery(function($) {
var timerArr = $.blinkTitle.show();
setTimeout(function() { //此处是过一定时间后自动消失
$.blinkTitle.clear(timerArr);
}, 10000);
//
});
</script>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/keenlove/wss.git
git@gitee.com:keenlove/wss.git
keenlove
wss
wss
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891