吉林省教师博客模板代码教程
2008年2月23日 郭连兵
一、修改OBLog官方博客模板《人》为996宽的代码
二、修改OBLog官方博客模板《中午》为996宽的代码
三、在博客页面中插入窗口特效代码
<STYLE type=text/css>
<!--
#sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}
-->
</STYLE>
<SCRIPT language=JavaScript1.2>
adTime=20;
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
adDiv.left=documentWidth-200;adDiv.top =documentHeight-40;
setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
onload=initAd;
</SCRIPT>
<DIV align=center>
<DIV id=sponsorAdDiv style="VISIBILITY: hidden">
<DIV align=left>
<TABLE height=330 width=450 bgColor=#008000>
<TBODY>
<TR>
<TD>
<TABLE height=325 width=445 bgColor=#f0fff0>
<TBODY>
<TR>
<TD>
<P align=center><STRONG><SPAN style="FONT-SIZE: 24pt"><SPAN style="COLOR: #ff0000">欢迎光临吉林省教师博客!</SPAN> </SPAN></STRONG></P>
<P align=center><STRONG><SPAN style="FONT-SIZE: 24pt"><SPAN style="COLOR: #2f4f4f">精彩你的博客 快乐你的人生!</SPAN> </SPAN></STRONG></P>
<P align=center><STRONG><SPAN style="FONT-SIZE: 24pt">打造最具个性的空间! </SPAN></STRONG></P>
<P align=center><STRONG><SPAN style="FONT-SIZE: 24pt">分享你的教师人生! </SPAN></STRONG></P>
<P align=center><SPAN lang=zh-cn style="FONT-SIZE: 24pt; COLOR: #000080"><STRONG>专业引领 经验分享 反思提高</STRONG></SPAN></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></DIV></DIV>
四、梦幻菜单
<SCRIPT language=JavaScript>
<!--我的梦幻开始
var currTimerlinePoint = 0;
var totalTimerlineFrames = 2;
var timerlineTimer;
var leftLine = 50;
var timerIn;
var timerOut;
var timerlineArray = new Array();
timerlineArray[0]='';
timerlineArray[1]='menuItemOut()';
function runTimerline(){
window.timerlineTimer = setTimeout('menuItemOut()',500);
}
function stopTimerline(){
clearTimeout(window.timerlineTimer);
//currTimerlinePoint = 0;
}
function menuItemIn(){
if( leftLine != 150){
item11.style.pixelLeft += 20; item11.filters.alpha.opacity += 20;
item12.style.pixelLeft -= 20; item12.filters.alpha.opacity += 20;
item13.style.pixelLeft += 20; item13.filters.alpha.opacity += 20;
item14.style.pixelLeft -= 20; item14.filters.alpha.opacity += 20;
item15.style.pixelLeft += 20; item15.filters.alpha.opacity += 20;
item16.style.pixelLeft -= 20; item16.filters.alpha.opacity += 20;
item17.style.pixelLeft += 20; item17.filters.alpha.opacity += 20;
item18.style.pixelLeft -= 20; item18.filters.alpha.opacity += 20;
item19.style.pixelLeft += 20; item19.filters.alpha.opacity += 20;
item20.style.pixelLeft -= 20; item20.filters.alpha.opacity += 20;
leftLine += 20;
}
else{
clearTimeout(window.timerIn);
return false;
}
timerIn=window.setTimeout('menuItemIn()',1);
}
function menuItemOut(){
clearTimeout(window.timerIn);
if (leftLine != 50){
item11.style.pixelLeft -= 20; item11.filters.alpha.opacity -= 20;
item12.style.pixelLeft += 20; item12.filters.alpha.opacity -= 20;
item13.style.pixelLeft -= 20; item13.filters.alpha.opacity -= 20;
item14.style.pixelLeft += 20; item14.filters.alpha.opacity -= 20;
item15.style.pixelLeft -= 20; item15.filters.alpha.opacity -= 20;
item16.style.pixelLeft += 20; item16.filters.alpha.opacity -= 20;
item17.style.pixelLeft -= 20; item17.filters.alpha.opacity -= 20;
item18.style.pixelLeft += 20; item18.filters.alpha.opacity -= 20;
item19.style.pixelLeft -= 20; item19.filters.alpha.opacity -= 20;
item20.style.pixelLeft += 20; item20.filters.alpha.opacity -= 20;
leftLine -= 20;
}
else{
clearTimeout(window.timerOut);
return false;
}
timerOut=window.setTimeout("menuItemOut()",1);
}
//-->
</SCRIPT>
<DIV style="LEFT: -80px; POSITION: absolute; TOP: -10px">
<DIV id=menu01 onmouseover=stopTimerline();menuItemIn() style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 14pt; Z-INDEX: 1; LEFT: 150px; BORDER-LEFT: #000000 1px; WIDTH: 100px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 33px; HEIGHT: 19px; BACKGROUND-COLOR: #4ff805; layer-background-color: #4FF805; FONT-: 9pt" onmouseout=runTimerline() align=center><SPAN style="COLOR: #ffffff">教师博客</SPAN></DIV>
<DIV id=item11 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 2; FILTER: alpha(opacity=0); LEFT: 50px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 4px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 55px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #DCFA52" onmouseout="this.style.backgroundColor= '#DCFA52';runTimerline()" align=center>精彩博客</DIV>
<DIV id=item12 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 3; FILTER: alpha(opacity=0); LEFT: 250px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 77px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>大智人生</DIV>
<DIV id=item13 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 4; FILTER: alpha(opacity=0); LEFT: 50px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 99px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>教育空间</DIV>;
<DIV id=item14 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 5; FILTER: alpha(opacity=0); LEFT: 250px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 121px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>真情永住</DIV>
<DIV id=item15 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 50px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 143px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>专业引领</DIV>
<DIV id=item16 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 250px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 165px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>经验分享</DIV>
<DIV id=item17 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 50px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 187px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>反思提高</DIV>
<DIV id=item18 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 250px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 209px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>携手助学</DIV>
<DIV id=item19 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 50px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 231px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>快乐学习</DIV>
<DIV id=item20 onmouseover="this.style.backgroundColor= '#E5FB81';stopTimerline()" style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; FONT-SIZE: 9pt; Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 250px; BORDER-LEFT: #000000 1px; WIDTH: 99px; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 253px; HEIGHT: 19px; BACKGROUND-COLOR: #dcfa52; layer-background-color: #dcfa52" onmouseout="this.style.backgroundColor= '#dcfa52';runTimerline()" align=center>潜力无限</DIV></DIV><!--我的梦幻结束
五、复制日志时带版权信息的代码
<SCRIPT>
document.body.oncopy=function(){
event.returnValue=false;
var s=document.selection.createRange().text;
re = ',';
t = s.replace(re, ',(本文转自[郭连兵博客]http:// blog.jledu.gov.cn/u/glb123/index.html,转载请注明出处,多谢合作.)');
clipboardData.setData('Text',t);
}
</SCRIPT>
六、QQ浮动窗口
<TR>
<TD> <A href="http://wpa.qq.com/msgrd?V=1&Uin=QQ&Site=www.szzfpc.cn&Menu=yes" target=blank><IMG alt=给发信息 src="http://wpa.qq.com/pa?p=1:QQ:4" align=absMiddle border=0></A> <A title=给发信息 href="http://wpa.qq.com/msgrd?V=1&Uin=QQ&Site=www.szzfpc.cn&Menu=yes" target=blank fond?></SPAN></A></TD></TR>
<TR>
<TD style="HEIGHT: 50px"> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD height=19><IMG height=19 src="/UploadFiles/2008-2/218409687.gif" width=111></TD></TR></TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var tips; var theTop = 150/*这是默认高度,越大越往下*/; var old = theTop;
function initFloatTips() {
tips = document.getElementById('QQFloat');
moveTips();
};
function moveTips() {
var tt=50;
if (window.innerHeight) {
pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
}
else if (document.body) {
pos = document.body.scrollTop;
}
pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+pos/10;
if (pos < theTop) pos = theTop;
if (pos != old) {
tips.style.top = pos+"px";
tt=10;
//alert(tips.style.top);
}
old = pos;
setTimeout(moveTips,tt);
}
//!]]>
initFloatTips();
</SCRIPT>
<STYLE type=text/css>
<!--
#sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}
-->
</STYLE>
<SCRIPT language=JavaScript1.2>
adTime=10;
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
adDiv.left=documentWidth-200;adDiv.top =documentHeight-40;
setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
onload=initAd;
</SCRIPT>
七、下拉菜单代码
<STYLE type=text/css>
.menubar{position:absolute;top:10px;width:100px;height:20px;cursor:default;border-width:1px;border-style:outset;color:yellow;background:#0099cc}
.menu{position:absolute;top:30px;width:140px;display:none;border-width:2px;border-style:outset;border-color:white sliver sliver white;background:yellow;padding:15px}
.menu A{text-decoration:none;color:blue}
.menu A:hover{color:#00ffff}
</STYLE>
<TABLE style="FONT-SIZE: 15px" cellSpacing=0 cellPadding=0 width=400 border=0>
<TBODY>
<TR>
<TD width="20%"></TD>
<TD width="20%"></TD></TR>
<TR>
<TD width="20%"></TD>
<TD width="20%"></TD></TR></TBODY></TABLE></SCRIPT></DIV></TD>
<TD>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><SPAN style="FONT-SIZE: 14pt; COLOR: #ff0000"></SPAN> </DIV></TD>
<TD> </TD></TR></TBODY></TABLE>
<TABLE class=content2 cellSpacing=0 cellPadding=0 width=996 align=center border=0>
<TBODY>
<TR>
<TD width=20><IMG height=1 alt="" src="/skin/20060601/1/fg.gif" width=20></TD>
<TD vAlign=top>
<DIV id=content>
<STYLE type=text/css>
.menubar{position:absolute;top:10px;width:100px;height:10px;cursor:default;border-width:1px;border-style:outset;color:yellow;background:#E1F1F1}
.menu{position:absolute;top:10px;width:140px;display:none;border-width:2px;border-style:outset;border-color:white sliver sliver white;background:yellow;padding:15px}
.menu A{text-decoration:none;color:blue}
.menu A:hover{color:#00ffff}
</STYLE>
<SCRIPT language=javascript>
function menuControl(show)
{
window.event.cancelBubble=true;
var objID=event.srcElement.id;
var index=objID.indexOf("_");
var mainID=objID.substring(0,index);
var numID=objID.substring(index+1,objID.length);
if(mainID=="menubar")
{
if(show==1)
{
eval("showMenu("+"menu_"+numID+")");
}
else
{
eval("hideMenu("+"menu_"+numID+")");
}
}
}
var nbottom=0,speed=1;
function displayMenu(obj)
{
obj.style.clip="rect(0 100% "+nbottom+"% 0)";
nbottom+=speed;
if(nbottom<=100)
{
timerID=setTimeout("displayMenu("+obj.id+"),70");
}
else clearTimeout(timerID);
}
function showMenu(obj)
{
obj.style.display="block";
obj.style.clip="rect(0 0 0 0)";
nbottom=5;
displayMenu(obj);
}
function hideMenu(obj)
{
nbottom=0;
obj.style.display="none";
}
function keepMenu(obj)
{
obj.style.display="block";
}
</SCRIPT>
<TABLE style="FONT-SIZE: 16px" cellSpacing=0 cellPadding=0 width=400 border=0>
<TBODY>
<TR>
<TD width="20%">
<DIV class=menubar id=menubar_1 onmouseover=menuControl(1) style="LEFT: 40px; WIDTH: 100px; TOP: 316px; HEIGHT: 24px" onmouseout=menuControl(0) align=center><A href="/u/ljbe/cmd.html?do=blogs&id=1278&uid=4399">学科学习</A> </DIV></TD>
<TD width="20%">
<DIV class=menubar id=menubar_2 onmouseover=menuControl(1) style="LEFT: 140px; WIDTH: 100px; TOP: 316px; HEIGHT: 24px" onmouseout=menuControl(0) align=center><A href="/u/ljbe/cmd.html?do=blogs&id=1359&uid=4399">我的作品</A> </DIV></TD></TR>
<TR>
<TD width="20%">
<DIV class=menu id=menu_1 onmouseover=keepMenu(this) style="LEFT: 40px; WIDTH: 100px; TOP: 340px; HEIGHT: 100px" onmouseout=hideMenu(this) align=left><A href="/u/ljbe/cmd.html?do=blogs&id=1278&uid=4399">学科学习</A> <BR><A href="/u/ljbe/cmd.html?do=blogs&id=1358&uid=4399">网络学习</A> <BR><A href="/u/ljbe/cmd.html?do=blogs&id=1361&uid=4399">高考交流</A> </DIV></TD>
<TD width="20%">
<DIV class=menu id=menu_2 onmouseover=keepMenu(this) style="LEFT: 140px; WIDTH: 100px; TOP: 340px; HEIGHT: 78px" onmouseout=hideMenu(this) align=left><A href="/u/ljbe/cmd.html?do=blogs&id=1359&uid=4399">我的作品</A> <BR><A href="/u/ljbe/cmd.html?do=blogs&id=1360&uid=4399">观光旅游</A></DIV></TD></TR></TBODY></TABLE></SCRIPT></DIV>