<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>this is a test</title> <script> document.addEventListener('visibilitychange',function(){ if(document.visibilityState=='hidden') { normal_title=document.title; document.title='(づ ̄ 3 ̄)づ'; } else document.title=normal_title; }); </script> </head> <body> <p>very 66666!</p> </body> </html>
此段代码 在切换页面后自动改变标题。js的简单应用。
简洁版
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <script language="JavaScript"> step=0 function flash_title() { step++ if (step==3) {step=1} if (step==1) {document.title='【你有新的消息】'} if (step==2) {document.title='【 】'} setTimeout("flash_title()",380); } flash_title() </script> 思源博客思源思源思源思源思源思源思源小哥哥 </body> </html>
兼容版
<script language="JavaScript"> setTimeout('flash_title()',2000); //2秒之后调用一次 function flash_title() { //当窗口效果为最小化,或者没焦点状态下才闪动 if(isMinStatus() || !window.focus) { newMsgCount(); } else { document.title='订单管理中心-AOOXING';//窗口没有消息的时候默认的title内容 window.clearInterval(); } } //消息提示 var flag=false; function newMsgCount(){ if(flag){ flag=false; document.title='【新订单】'; }else{ flag=true; document.title='【 】'; } window.setTimeout('flash_title(0)',380); } //判断窗口是否最小化 //在Opera中还不能显示 var isMin = false; function isMinStatus() { //除了Internet Explorer浏览器,其他主流浏览器均支持Window outerHeight 和outerWidth 属性 if(window.outerWidth != undefined && window.outerHeight != undefined){ isMin = window.outerWidth <= 160 && window.outerHeight <= 27; }else{ isMin = window.outerWidth <= 160 && window.outerHeight <= 27; } //除了Internet Explorer浏览器,其他主流浏览器均支持Window screenY 和screenX 属性 if(window.screenY != undefined && window.screenX != undefined ){ isMin = window.screenY < -30000 && window.screenX < -30000;//FF Chrome }else{ isMin = window.screenTop < -30000 && window.screenLeft < -30000;//IE } return isMin; } </script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TITLE栏上滚动的文字</title> <script language=javascript > var text=document.title var timerID function newtext() { clearTimeout(timerID) document.title=text.substring(1,text.length)+text.substring(0,1) text=document.title.substring(0,text.length) timerID = setTimeout("newtext()", 100) } </script> </head> <body onload="newtext()"></body> </body> </html> <html> <head>
QQ空间批量删说说日志代码分享 操作步骤: 1.电脑进入自己QQ空间页面->点说说或者日志->进来页面后->鼠标右键->审核米素->点左边下面的第二个英...
这次分享的xml代码是点赞送老婆 代码中的85443298是跳转的QQ号,替换成自己的即可 其他信息可以参照往期内容进行修改 <?xml version='1.0' encod...
利用JS简单快速批量取消微博的关注 微博关注的人太多了,一个一个取消很麻烦?那么这个方法很适合你,和全自动取关都差不多了,只适用于电脑用户! 步骤如下 1.电...
jquery-2.1.1 (注!jquery-2.0以上版本不再支持IE 6/7/8) 百度引用地址 (推荐目前最稳定的,不会出现延时打不开情况)百度压缩版引用地址: <script src...
获取域名等信息 <? //获取当前的域名: echo $_SERVER['SERVER_NAME']; //获取来源网址,即点击来到本页的上页网址 echo $_SERVER["HTTP_RE...
在杨小杰博客看到的 在以前某博客的某页面也见过类似效果 分享给大家 大致原理就是根据滚动距离和文档高度排定滚动百分比然后绘制画布,百分比数字是用data储存并使用css的 content属性实现...