| 项目搜索 |
| |
|
代码片段库:
查看代码片段
浏览
| 提交新的代码片段
| 创建代码包
模糊的文字导航
|
类型:
Function |
类别:
HTML Manipulation
|
许可证:
GNU General Public License |
语言:
JavaScript
|
描述:
模糊的导航文字,鼠标放上去后文字有变化效果 来源:http://www.baron.com.cn
|
该代码片段的版本系列:
片段ID |
下载版本 |
提交时间 |
提交人 |
删除 |
4784 | 1.0 | 2003-10-24 04:18 | cbd001 | |
点击"下载版本"来下载该代码片段.
最新版本的代码片段: 1.0
脚本说明:
把如下代码加入<head>区域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function locktrueie(myform){myform.ie.checked=true;}
function lockfalsenet(myform){myform.nets.checked=true;}
function goToURL() { window.location = "http://www.jzzy.com"; }
function nochange(mycheckbox)
{
if (mycheckbox.checked == true){mycheckbox.checked = false;}else{mycheckbox.checked = true;}
}
// End -->
</script>
<style>
. tds
{
background-Color:silver;
width:100;
height:20;
text-align:center;
border:1px solid gray;
font-size:14;
filter:alpha(opacity=45);
-moz-opacity:45%;
cursor:crosshair;
}
</style>
<script language="javascript">
nOpac = 50
nPlus = 2
nMin = 1
speed = 30
timer = null;
timer2 = null;
var ie5=(document.all && document.getElementById);
var ns6=(!document.all && document.getElementById);
function fadeImg2(teller)
{
apl[teller][1] = "Up";
changes();
}
function fadeImgend2(teller)
{
apl[teller][1] = "Down";
setTimeout("changes()",50);
}
function changes()
{
next_loop = true;
for (i=0;i<apl.length;i++)
{
obj = link_table.rows[i].cells[0];
opacity = apl[i][0]
if (apl[i][1] == "Up")
{
opacity += nPlus;
apl[i][0] = opacity;
if (apl[i][0] > 105)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
else
{
if (apl[i][1] == "Down")
{
opacity -= nMin;
apl[i][0] = opacity;
if (apl[i][0] < 45)
{apl[i][1] = "";}
else
{next_loop = false;}
nOpac = opacity;
}
}
if(ie5){
obj.style.filter="alpha(opacity="+opacity+")";
}
if(ns6){
obj.style.MozOpacity = opacity + '%';
}
}
if (next_loop == false)
{
timer = setTimeout("changes()",speed);
}
else
{
clearTimeout(timer);
}
}
//for each link option you need to make a new Array;
var apl = new Array();
apl[0] = new Array(45,"");
apl[1] = new Array(45,"");
apl[2] = new Array(45,"");
apl[3] = new Array(45,"");
apl[4] = new Array(45,"");
apl[5] = new Array(45,"");
//expl: apl[6] = new Array(45,"");
</script>
<table cellpadding=0 cellspacing=0 name=link_table id=link_table>
<tr>
<td class="tds" onmouseover="fadeImg2(0)" onmouseout="fadeImgend2(0)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接一</td>
</tr>
<tr>
<td class="tds" onmouseover="fadeImg2(1)" onmouseout="fadeImgend2(1)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接二</td>
</tr>
<tr>
<td class="tds" onmouseover="fadeImg2(2)" onmouseout="fadeImgend2(2)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接三</td>
</tr>
<tr>
<td class="tds" onmouseover="fadeImg2(3)" onmouseout="fadeImgend2(3)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接四</td>
</tr>
<tr>
<td class="tds" onmouseover="fadeImg2(4)" onmouseout="fadeImgend2(4)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接五</td>
</tr>
<tr>
<td class="tds" onmouseover="fadeImg2(5)" onmouseout="fadeImgend2(5)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接六</td>
</tr>
</table>
如果您修改了一个代码片段并且觉得很应该让别人共享,您可以把这作为这个代码片段的最新版本提交上来. |
|