奇怪!我明明在javascript中设了样式,可不起作用!!!!! 是 clickCls 可能与浏览器有关吧,我的是ie5.5 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢解决了不过还是有些问题<HTML><HEAD><style>BODY { FONT-SIZE: 12px; FONT-FAMILY: 宋体; font-color: #000000}.clickCls{ BACKGROUND-COLOR: black ; COLOR: white; BORDER-BOTTOM: 1PX SOLID blue; BORDER-RIGHT: 1PX SOLID blue; BORDER-LEFT: 1PX SOLID blue; BORDER-TOP: 1PX SOLID blue; }.highlightCls{ BACKGROUND-COLOR: #EFE7DE ; COLOR: #737054; BORDER-BOTTOM: 1PX SOLID blue; BORDER-RIGHT: 1PX SOLID blue; BORDER-LEFT: 1PX SOLID blue; BORDER-TOP: 1PX SOLID blue; }.lowlightCls{ BACKGROUND-COLOR: ; COLOR: BLACK; BORDER: 0}</style><script>function highlightie5(oObject){if (oObject.style.backgroundColor!="BLACK"){ oObject.className='highlightCls'; }window.status=event.srcElement.url;}function lowlightie5(oObject){//alert(event.srcElement.style.backgroundColor)if (event.srcElement.style.backgroundColor!="black"){ oObject.className='lowlightCls'; }}//点击链接后使其变色function ClickLink(oObject){ //先将所有其他的链接都恢复原有的状态 var i=document.links.length; for (var j=0; j<i;j++) { document.links[j].style.backgroundColor=""; document.links[j].style.color="black"; document.links[j].style.border=0; } //alert(oObject.className); oObject.className='clickCls'; alert(oObject.style.backgroundColor)//这里显示的结果为空 //而clickCls设的是 //BACKGROUND-COLOR: black ; //alert(oObject.className); //alert(event.srcElement.tagName); //alert(oObject.className) //alert(oObject.style.border) //event.cancelBubble=true event.returnValue=false}</script></HEAD><BODY ><A href="" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪</A><BR><A href="" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海热线</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪gfdfgerg</A><BR><A href="" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">热线</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪gdsfdsfsfdsfsdfsdfs</A><BR><A href="" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海fdsfdsfdsfdsfd热线</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪dfdsfsdfsd</A><BR></BODY></HTML> 问题出在这里function ClickLink(oObject){ //先将所有其他的链接都恢复原有的状态 var i=document.links.length; for (var j=0; j<i;j++) { document.links[j].style.backgroundColor=""; document.links[j].style.color="black"; document.links[j].style.border=0; } oObject.className='clickCls'; alert(oObject.style.backgroundColor)//这里显示的结果为空 //而clickCls设的是 //BACKGROUND-COLOR: black ; event.returnValue=false} js 动态添加行不显示,急!!! js限制TextBox输入的长度 HTML中如何使<a>标签不可用 改变button的value,也就是改变按钮上的标题 求Web中播放音频的解决方案 怎么判断重复提交的值不同 急急急急急急急急急急急!!!!遍历table中checkbox 问题如下:解决结帐 怎样刷新第二个窗口? 怎么樣在js中控制表格背景圖片的變換???? 如何用javascript代码现实页面控件的隐藏,不可见但此控件的值还是可以取出的?请相帮 new Option是不是JavaScript的对象
解决了
不过还是有些问题
<HTML>
<HEAD><style>
BODY {
FONT-SIZE: 12px; FONT-FAMILY: 宋体; font-color: #000000
}
.clickCls{
BACKGROUND-COLOR: black ;
COLOR: white;
BORDER-BOTTOM: 1PX SOLID blue;
BORDER-RIGHT: 1PX SOLID blue;
BORDER-LEFT: 1PX SOLID blue;
BORDER-TOP: 1PX SOLID blue;
}
.highlightCls{
BACKGROUND-COLOR: #EFE7DE ;
COLOR: #737054;
BORDER-BOTTOM: 1PX SOLID blue;
BORDER-RIGHT: 1PX SOLID blue;
BORDER-LEFT: 1PX SOLID blue;
BORDER-TOP: 1PX SOLID blue;
}
.lowlightCls{
BACKGROUND-COLOR: ;
COLOR: BLACK;
BORDER: 0
}</style>
<script>function highlightie5(oObject){
if (oObject.style.backgroundColor!="BLACK")
{
oObject.className='highlightCls';
}
window.status=event.srcElement.url;}function lowlightie5(oObject){
//alert(event.srcElement.style.backgroundColor)
if (event.srcElement.style.backgroundColor!="black")
{
oObject.className='lowlightCls';
}
}//点击链接后使其变色
function ClickLink(oObject)
{
//先将所有其他的链接都恢复原有的状态
var i=document.links.length;
for (var j=0; j<i;j++)
{
document.links[j].style.backgroundColor="";
document.links[j].style.color="black";
document.links[j].style.border=0;
}
//alert(oObject.className);
oObject.className='clickCls';
alert(oObject.style.backgroundColor)//这里显示的结果为空
//而clickCls设的是
//BACKGROUND-COLOR: black ;
//alert(oObject.className);
//alert(event.srcElement.tagName);
//alert(oObject.className)
//alert(oObject.style.border)
//event.cancelBubble=true
event.returnValue=false
}
</script>
</HEAD>
<BODY ><A href="" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海</A><BR>
<A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪</A><BR>
<A href="" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海热线</A><BR>
<A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪gfdfgerg</A><BR>
<A href="" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">热线</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪gdsfdsfsfdsfsdfsdfs</A><BR><A href="" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this) target="_blank">上海fdsfdsfdsfdsfd热线</A><BR><A href="http://www.sina.com.cn" onmouseout=lowlightie5(this)
onmouseover=highlightie5(this) onclick=ClickLink(this)>新浪dfdsfsdfsd</A><BR></BODY>
</HTML>
function ClickLink(oObject)
{
//先将所有其他的链接都恢复原有的状态
var i=document.links.length;
for (var j=0; j<i;j++)
{
document.links[j].style.backgroundColor="";
document.links[j].style.color="black";
document.links[j].style.border=0;
} oObject.className='clickCls';
alert(oObject.style.backgroundColor)//这里显示的结果为空
//而clickCls设的是
//BACKGROUND-COLOR: black ;
event.returnValue=false
}