<!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> <title>顶部展出的大幅广告</title> <script type="text/javascript" language="javascript"> var time = 500; var h = 0; function addCount() { if(time>0) { time--; h = h+5; } else { return; } if(h>500) //高度 { return; } document.getElementById("ads").style.display = ""; document.getElementById("ads").style.height = h+"px"; setTimeout("addCount()",30); } window.onload = function showAds() { addCount(); setTimeout("noneAds()",7000); //停留时间自己适当调整 } </script> <script type="text/javascript" language="javascript"> var T = 500; var N = 500; //高度 function noneAds() { if(T>0) { T--; N = N-5; } else { return; } if(N<0) { document.getElementById("ads").style.display = "none"; return; } document.getElementById("ads").style.height = N+"px"; setTimeout("noneAds()",30); } </script> </head> <body> <div id="ads" style="margin:auto; display:none; width:900px; top:0px; height:0px; border:solid 1px #000; background-color:#fafafa; overflow:hidden; text-align:center;"> <a target="_blank" href="http://www.test.com">网页址:http://www.webjx.com</a> </div> <div style="margin:auto; width:900px; height:200px; border:solid 1px #000; background-color:#fafafa; text-align:center;"> 网站主体内容 </div> </body> </html>
2012-1-30 11:22 Monday
2012-1-30 11:21 Monday
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"> <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"> <HEAD> <TITLE>随滚动条移动的层</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html" charset="gb2312"> <META NAME="Author" CONTENT="haiwa"> <META NAME="homepage" CONTENT="www.danglinlin.cn"> </HEAD> <style> <!-- .div{ position: absolute; border: 2px solid red; background-color: #EFEFEF; line-height:90px; font-size:12px; z-index:1000; } --> </style> <BODY> <div id="Javascript.Div1" class="div" style="width: 240px; height:90px" align="center">正中...</div> <SCRIPT LANGUAGE="JavaScript"> function sc1(){ document.getElementById("Javascript.Div1").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("Javascript.Div1").offsetHeight)/2)+"px"; document.getElementById("Javascript.Div1").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("Javascript.Div1").offsetWidth)/2)+"px"; } </SCRIPT> <div id="Javascript.Div2" class="div" style="width: 240px; height:90px" align="center">左上...</div> <SCRIPT LANGUAGE="JavaScript"> function sc2(){ document.getElementById("Javascript.Div2").style.top=(document.documentElement.scrollTop)+"px"; document.getElementById("Javascript.Div2").style.left=(document.documentElement.scrollLeft)+"px"; } </SCRIPT> <div id="Javascript.Div3" class="div" style="width: 240px; height:90px" align="center">左下...</div> <SCRIPT LANGUAGE="JavaScript"> function sc3(){ document.getElementById("Javascript.Div3").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("Javascript.Div3").offsetHeight)+"px"; document.getElementById("Javascript.Div3").style.left=(document.documentElement.scrollLeft)+"px"; } </SCRIPT> <div id="Javascript.Div4" class="div" style="width: 240px; height:90px" align="center">右上...</div> <SCRIPT LANGUAGE="JavaScript"> function sc4(){ document.getElementById("Javascript.Div4").style.top=(document.documentElement.scrollTop)+"px"; document.getElementById("Javascript.Div4").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.Div4").offsetWidth)+"px"; } </SCRIPT> <div id="Javascript.Div5" class="div" style="width: 240px; height:90px" align="center">右下...</div> <SCRIPT LANGUAGE="JavaScript"> function sc5(){ document.getElementById("Javascript.Div5").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("Javascript.Div5").offsetHeight)+"px"; document.getElementById("Javascript.Div5").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.Div5").offsetWidth)+"px"; } </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> <!-- function scall(){ sc1();sc2();sc3();sc4();sc5(); } window.onscroll=scall; window.onresize=scall; window.onload=scall; //--> </SCRIPT> <div style="position: absolute; top: 0px; left: 0px; width: 10000px; height: 4000px;"></div> </BODY> </HTML>
2012-1-30 11:19 Monday
<body> 页面代码: <div id="menu1" onclick="TreeMenu(this,'child1')"> <img src="plus.gif" ><a href="#">菜单1</a> </div> <div id="child1" style="display:none"> <a href="#">页面1</a><br> <a href="#">页面2</a> </div> <div id="menu2" onclick="TreeMenu(this,'child2')"> <img src="plus.gif"><a href="#">菜单2</a> </div> <div id="child2" style="display:none"> <a href="#">页面1</a><br> <a href="#">页面2</a> </div> <script language=javascript> function TreeMenu(node,id) { var sibling = document.getElementById(id); if (sibling.style.display == 'none') { if (node.childNodes.length > 0) { if (node.childNodes[0].tagName == "IMG") { node.childNodes[0].src = "minus.gif"; //替换为展开时的图片 } } sibling.style.display = ''; } else { if (node.childNodes.length > 0) { if (node.childNodes[0].tagName == "IMG") { node.childNodes[0].src = "plus.gif"; //替换为 } } sibling.style.display = 'none'; } } </script> </body>
2012-1-30 11:10 Monday
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>新建网页 3</title> </head> <body> <script language="javascript"> document.body.oncopy = function () //当发生复制事件时触发函数,不管是ctrl+c还是右键-复制 { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\n该文章转载自blog:"+location.href; clipboardData.setData("text", text); } }, 100 ) } window.onload = function() { this.focus(); //内容加载完成后,获取焦点 } </script> sdfsdfsdf </body> </html>
2012-1-29 21:00 Sunday
从今天开始,开始我的PHP记录之旅!