1、网页制作的提示框颜色更改问题
四种提示框代码
<head>
<title>图像效果演示</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
/*
舜子制作
Made by PuterJam
*/
//--初始化变量--
var rT=true;//允许图像过渡
var bT=true;//允许图像淡入淡出
var tw=150;//提示框宽度
var endaction=false;//结束动画
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
{
if(ns4||ns6||ie4)
{
if(ns4) toolTipSTYLE = document.toolTipLayer;
else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
if(ns4) document.captureEvents(Event.MOUSEMOVE);
else
{
toolTipSTYLE.visibility = "visible";
toolTipSTYLE.display = "none";
}
document.onmousemove = moveToMouseLoc;
}
}
function toolTip(msg, fg, bg)
{
if(toolTip.arguments.length < 1) // hide
{
if(ns4)
{
toolTipSTYLE.visibility = "hidden";
}
else
{
//--图象过渡,淡出处理--
if (!endaction) {toolTipSTYLE.display = "none";}
if (rT) document.all("msg1").filters[1].Apply();
if (bT) document.all("msg1").filters[2].Apply();
document.all("msg1").filters[0].opacity=0;
if (rT) document.all("msg1").filters[1].Play();
if (bT) document.all("msg1").filters[2].Play();
if (rT){
if (document.all("msg1").filters[1].status==1 || document.all("msg1").filters[1].status==0){
toolTipSTYLE.display = "none";}
}
if (bT){
if (document.all("msg1").filters[2].status==1 || document.all("msg1").filters[2].status==0){
toolTipSTYLE.display = "none";}
}
if (!rT && !bT) toolTipSTYLE.display = "none";
//----------------------
}
}
else // show
{
if(!fg) fg = "#777777";
if(!bg) bg = "#eeeeee";
var content =
@#<table id="msg1" name="msg1" border="0" cellspacing="0" cellpadding="1" bgcolor="@# + fg + @#" class="trans_msg"><td>@# +
@#<table border="0" cellspacing="0" cellpadding="3" bgcolor="@# + bg +
@#"><td width=@# + tw + @#><font face="Arial" color="@# + fg +
@#" size="-2">@# + msg +
@# \;</font></td></table></td></table>@#;
if(ns4)
{
toolTipSTYLE.document.write(content);
toolTipSTYLE.document.close();
toolTipSTYLE.visibility = "visible";
}
if(ns6)
{
document.getElementById("toolTipLayer").innerHTML = content;
toolTipSTYLE.display=@#block@#
}
if(ie4)
{
document.all("toolTipLayer").innerHTML=content;
toolTipSTYLE.display=@#block@#
//--图象过渡,淡入处理--
var cssopaction=document.all("msg1").filters[0].opacity
document.all("msg1").filters[0].opacity=0;
if (rT) document.all("msg1").filters[1].Apply();
if (bT) document.all("msg1").filters[2].Apply();
document.all("msg1").filters[0].opacity=cssopaction;
if (rT) document.all("msg1").filters[1].Play();
if (bT) document.all("msg1").filters[2].Play();
//----------------------
}
}
}
function moveToMouseLoc(e)
{
if(ns4||ns6)
{
x = e.pageX;
y = e.pageY;
}
else
{
x = event.x + document.body.scrollLeft;
y = event.y + document.body.scrollTop;
}
toolTipSTYLE.left = x + offsetX;
toolTipSTYLE.top = y + offsetY;
return true;
}
</script>
<style type="text/css">
<!--
.trans_msg
{
filter:alpha(opacity=100,enabled=1) revealTrans(ration=.2,transition=1) blendtrans(ration=.2);
}
-->
</style>
</head>
<script>
</script>
<body>
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<p>
<script>initToolTips()</script>
</p>
<p><font face="Arial"><a href="#" onMouseOver="toolTip(@#欢迎访问Blyesky的blog<br>希望你喜欢这里<br>^_^@#)" onMouseOut="toolTip()">效果1</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#你要吗,好好用的哦真的@#, @##FFFF00@#, @#red@#)" onMouseOut="toolTip()">效果2</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#这是个好东东<br>你说呢<br>哈哈@#, @##FFFF00@#, @#orange@#)" onMouseOut="toolTip()">效果3</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#<marquee>跑啊!!跑</marquee>@#, @##FFFF00@#, @#orange@#)" onMouseOut="toolTip()">效果4</a></font>
</p>
</body>
2、同一页面如何设置不同的链接颜色
用CSS分别设置。
先看一下常用设置:
a:link 超链接的普通样式
a:visited 点击过的
a:hover 鼠标经过时的
a:active 单击时
a:link{text-decoration:none;} 无下划线
a:link{text-decoration:underline;} 有下划线
为了实现不同链接不同效果,我们要为不同效果的那个链接专门定义一个css规则。
比如:
我们常规css是这样的:
a:link{color:#ff0000}
那么网页上所有链接的颜色都是:#ff0000。
现在我们改一下:
a:link{color:#ff0000}
.line1 a:link{color:#000000}
同时,在要改变颜色的链接前加上css定义,像这样:<span class=line1><a href="/">不同颜色的超链接</a></span>,这样的话,这个链接的颜色就改变了。
3、javascript 代码问题 跪谢!! 根据如下代码,怎样修改使得点击按钮时网页背景出现相应颜色的变化
代码在哪里呢
获得网页的背景色和字体颜色,方法如下:
var rgb = document.getElementById('color').style.backgroundColor;
得到格式如下: rgb(225, 22, 23); 然后进行拆分:
var rgb = rgb.split('(')[1]; //拆分后为 [rgb, 225,22,23)]形式,长度为2的数组
再将 (225,22,23)字符串进行拆分(注意:只有number类型的才能转换,所以用 parseInt 强制转换类型!) :
4、网页设计中如何设置网页的提示信息
你指的提示 是不是鼠标移动到文字上出现的提示框
如果是的话 这个需要css配合js实现
5、网页中不同超链接文字如何设置不同的颜色?
设置不同链接的文字颜色,示例如下:
<!DOCTYPE HTML>希望能帮到你,有问题随时问我
6、如何在网页中做鼠标经过不同文字变不同颜色色效果
<html>
<head>
<style>
a.ji{color: blue; }
a.jl:hover{color: red}
a.un{text-decoration : none }
a.un:hover{text-decoration: underline;}
a.com{color="white"}
a.com:hover{color:black;}
</style>
</head>
<body>
<a href="" class="jl">个人简历</a><br><br><br><br>
<a href="" class="com">公司简介</a><br><br><br><br>
<a href="" class="un">我有下划线哦</a><br>
</body>
</html>
7、用js 使同一行字字 显示不同的颜色
你给每个字加上span,让后方别给color赋值就可以了
8、用javascript给网页换肤,能在不同的浏览器上看是一样的颜色吗
问题分析:
你的意思是想保持切换皮肤的设置。那就要有一个默认加载的样式表。比如你默认的加载的是红色的样式。点切换成绿色,用javascript动态加载绿色的样式表文件。而javascript 记录一些信息是可以的比如用cookie,但是这些信息知识记录在客户端代理(浏览器)上的。所以当IE切换了火狐并没有记录,还是会去加载默认的红色样式表。并且在别人的电脑的IE浏览器也是加载的默认的。所以不能。
解决方法:
结合数据库存储一下客户设置的样式,每次加载的时候读取一下数据库,然后加载样式,这样很简单。
9、PHP网页制作问题<script>不重复显示的问题
不知道是我没有理解,还是没有表述清楚:这样吧,你是不是想要达到如下的样子?如果是的话,我提供的代码完全能达到要求,如果不是,就请把问题详细描述一下吧:
<script language="javascript">
<!--
var bsYear;
var bsDate;
..........
document.write(bsDate+bsDate2+" "+bsWeek+" "+bsYear+" "+bsYear2);
}
//-->
</script>
<script language="javascript">CAL();</script>
<table width="10" border="0" cellspacing="0" cellpadding="0" class="mainmenu">
<tr>
<td align="center" nowrap="nowrap"><strong>|</strong></td>
<td align="center" nowrap="nowrap"><div align="left" id="r{#rxmenuid#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})" style="position:absolute; display:none; margin:2px; width:110px; height:20px; padding-top:5px; ">
<ul class="twomenu">{#rxmenuej#}</ul></div>
<a href="{#rxmenuip#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})"
target="{#rxmenuopen#}">{#rxmenutitle#}</a></td>
</tr>
</table>
<table width="10" border="0" cellspacing="0" cellpadding="0" class="mainmenu">
<tr>
<td align="center" nowrap="nowrap"><strong>|</strong></td>
<td align="center" nowrap="nowrap"><div align="left" id="r{#rxmenuid#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})" style="position:absolute; display:none; margin:2px; width:110px; height:20px; padding-top:5px; ">
<ul class="twomenu">{#rxmenuej#}</ul></div>
<a href="{#rxmenuip#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})"
target="{#rxmenuopen#}">{#rxmenutitle#}</a></td>
</tr>
</table>
<table width="10" border="0" cellspacing="0" cellpadding="0" class="mainmenu">
<tr>
<td align="center" nowrap="nowrap"><strong>|</strong></td>
<td align="center" nowrap="nowrap"><div align="left" id="r{#rxmenuid#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})" style="position:absolute; display:none; margin:2px; width:110px; height:20px; padding-top:5px; ">
<ul class="twomenu">{#rxmenuej#}</ul></div>
<a href="{#rxmenuip#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})"
target="{#rxmenuopen#}">{#rxmenutitle#}</a></td>
</tr>
</table>
<table width="10" border="0" cellspacing="0" cellpadding="0" class="mainmenu">
<tr>
<td align="center" nowrap="nowrap"><strong>|</strong></td>
<td align="center" nowrap="nowrap"><div align="left" id="r{#rxmenuid#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})" style="position:absolute; display:none; margin:2px; width:110px; height:20px; padding-top:5px; ">
<ul class="twomenu">{#rxmenuej#}</ul></div>
<a href="{#rxmenuip#}" onMouseOver="menuej(1,r{#rxmenuid#})" onMouseOut="menuej(2,r{#rxmenuid#})"
target="{#rxmenuopen#}">{#rxmenutitle#}</a></td>
</tr>
</table>