我是按书本打,好像有错,谁可以看下,帮忙改正
<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
.coolBar{background:#00aafc; border-top:1px solid buttonhighlight;border-left:1px solid buttonhighlight; border-bottom:1px solid buttonhighlight; border-right:1px solid buttonhighlight; padding:2px; font:menu;}
.coolBar{font-size:9pt; border:1px solid buttonhighlight; padding: 1px; text-align:center; cursor:hand; color:#ee0055}
<BODY onLoad='fix()' onScroll="fix()" onResize="fix()">
</style>
<script language="javascript">
function fix(){
var a=document.body.scrollTop;
var b=document.body.scrollLeft;
bar.style.top=a;
bar.style.left=b;
}
document.onmousedown=doDown;
function doDown(){
el = getReal(window.event.srcElement,"className","coolButton");
var cDisabled = el.cDisabled;
cDisabled = (cDisabled != null);
if((el.className == "coolButton")&& !cDisabled){
makePressed(el)
}
}
function getreal(el,type,value){
temp=el;
while ((temp !=null)&& (temp.tagName !="BODY")){
if (eval("temp."+type) == value){
el = temp;
return el;
}
temp = temp.parentElement;
}
return el;
}
function makePressed(el){
with (el.style ){
borderLeft = "1px solid buttonhighlight";
borderRight = "1px solid buttonhighlight";
borderTop = "1px solid buttonhighlight";
borderBottom = "1px solid buttonhighlight";
paddingTop = "2px";
paddingLeft = "2px";
paddingBottom = "0px";
paddingRight="0px";
}
}
document.onmouseup = doUp;
function doUp() {
el = getReal(window.event.srcElement,"className","coolButton");
var cDisabled = el.cDisbled;
cDisabled = (cDisabled != null);
if((el.className == "coolButton")&& !cDisabled){
makeRaised(el);
}
}
function makeRaised(el){
with (el.style){
borderLeft = "1px solid #2F8BDF";
borderRight = "1px solid #2F8BDF";
borderTto = "1px solid #2F8BDF";
borderBottom = "1px solid #2F8BDF";
padding = "1px";
}
}
</script>
</head>
<body>
<span id="bar" style="position:absolute; left:0px; top:0px; widows:500px; height:1px; z-index:9">
<table class=coolbar id=toolbarl width=100%>
<tr>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">论坛</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">天气</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">邮件</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">留言板</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">聊天室</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">微博</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">博客</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">新闻</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">文化</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">军事</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">理财</td>
</tr>
</table>
</span>
</body>
</html>
<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
.coolBar{background:#00aafc; border-top:1px solid buttonhighlight;border-left:1px solid buttonhighlight; border-bottom:1px solid buttonhighlight; border-right:1px solid buttonhighlight; padding:2px; font:menu;}
.coolBar{font-size:9pt; border:1px solid buttonhighlight; padding: 1px; text-align:center; cursor:hand; color:#ee0055}
<BODY onLoad='fix()' onScroll="fix()" onResize="fix()">
</style>
<script language="javascript">
function fix(){
var a=document.body.scrollTop;
var b=document.body.scrollLeft;
bar.style.top=a;
bar.style.left=b;
}
document.onmousedown=doDown;
function doDown(){
el = getReal(window.event.srcElement,"className","coolButton");
var cDisabled = el.cDisabled;
cDisabled = (cDisabled != null);
if((el.className == "coolButton")&& !cDisabled){
makePressed(el)
}
}
function getreal(el,type,value){
temp=el;
while ((temp !=null)&& (temp.tagName !="BODY")){
if (eval("temp."+type) == value){
el = temp;
return el;
}
temp = temp.parentElement;
}
return el;
}
function makePressed(el){
with (el.style ){
borderLeft = "1px solid buttonhighlight";
borderRight = "1px solid buttonhighlight";
borderTop = "1px solid buttonhighlight";
borderBottom = "1px solid buttonhighlight";
paddingTop = "2px";
paddingLeft = "2px";
paddingBottom = "0px";
paddingRight="0px";
}
}
document.onmouseup = doUp;
function doUp() {
el = getReal(window.event.srcElement,"className","coolButton");
var cDisabled = el.cDisbled;
cDisabled = (cDisabled != null);
if((el.className == "coolButton")&& !cDisabled){
makeRaised(el);
}
}
function makeRaised(el){
with (el.style){
borderLeft = "1px solid #2F8BDF";
borderRight = "1px solid #2F8BDF";
borderTto = "1px solid #2F8BDF";
borderBottom = "1px solid #2F8BDF";
padding = "1px";
}
}
</script>
</head>
<body>
<span id="bar" style="position:absolute; left:0px; top:0px; widows:500px; height:1px; z-index:9">
<table class=coolbar id=toolbarl width=100%>
<tr>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">论坛</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">天气</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">邮件</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">留言板</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">聊天室</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">微博</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">博客</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">新闻</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">文化</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">军事</td>
<td class=coolButton onclick="Javascript:self.location='Untitled-2.html'">理财</td>
</tr>
</table>
</span>
</body>
</html>