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>