| 项目搜索 |
| |
|
代码片段库:
查看代码片段
浏览
| 提交新的代码片段
| 创建代码包
数字导航效果
|
类型:
Full Script |
类别:
HTML Manipulation
|
许可证:
GNU General Public License |
语言:
JavaScript
|
描述:
给你0-9的数字按钮,点击相应的数字后就会导出相应的网站 来源:http://www.baron.com.cn 1.0
|
该代码片段的版本系列:
片段ID |
下载版本 |
提交时间 |
提交人 |
删除 |
4792 | 1.0 | 2003-10-24 04:28 | cbd001 | |
点击"下载版本"来下载该代码片段.
最新版本的代码片段: 1.0
脚本说明:
把如下代码加入<body>区域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var phone_num='';
var timerID = null;
var timerRunning = false;
function but1()
{
phone_num = phone_num + '1';
chknum();
}
function but2()
{
phone_num = phone_num + '2';
chknum();
}
function but3()
{
phone_num = phone_num + '3';
chknum();
}
function but4()
{
phone_num = phone_num + '4';
chknum();
}
function but5()
{
phone_num = phone_num + '5';
chknum();
}
function but6()
{
phone_num = phone_num + '6';
chknum();
}
function but7()
{
phone_num = phone_num + '7';
chknum();
}
function but8()
{
phone_num = phone_num + '8';
chknum();
}
function but9()
{
phone_num = phone_num + '9';
chknum();
}
function but0()
{
phone_num = phone_num + '0';
chknum();
}
function chknum()
{
//ADD YOUR NUMBERS AND URLS HERE
if (phone_num=="01")
document.location="http://www.jzzy.com";
if (phone_num=="123")
document.location="http://www.cctv.com";
if (phone_num=="1245")
document.location="http://www.163.com";
document.board.pn.value=phone_num;
}
function clearit()
{
phone_num = "";
document.board.pn.value=phone_num;
}
// End -->
</script>
<h2>01= www.jzzy.com & 123= www.cctv.com</h2>
<form name="board">
<center>
<table BORDER CELLSPACING=0 CELLPADDING=0 COLS=3 WIDTH="135" BGCOLOR="#FF0000" >
<tr ALIGN=CENTER>
<td><input type=button value=" 1 "onClick="but1(); window.focus()"></td>
<td><input type=button value=" 2 "onClick="but2(); window.focus()"></td>
<td><input type=button value=" 3 "onClick="but3(); window.focus()"></td>
</tr>
<tr ALIGN=CENTER>
<td><input type=button value=" 4 "onClick="but4(); window.focus()"></td>
<td><input type=button value=" 5 "onClick="but5(); window.focus()"></td>
<td><input type=button value=" 6 "onClick="but6(); window.focus()"></td>
</tr>
<tr ALIGN=CENTER>
<td><input type=button value=" 7 "onClick="but7(); window.focus()"></td>
<td><input type=button value=" 8 "onClick="but8(); window.focus()"></td>
<td><input type=button value=" 9 "onClick="but9(); window.focus()"></td>
</tr>
<tr ALIGN=CENTER>
<td COLSPAN="3">
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="100%" >
<tr>
<td ALIGN=CENTER WIDTH="50%"><input type=button value=" 0 "onClick="but0(); window.focus()"></td>
<td ALIGN=CENTER WIDTH="50%"><input type=button value="Reset"onClick="clearit(); window.focus()"></td>
</tr>
</table></center>
</td>
</tr>
<tr>
<td ALIGN=CENTER COLSPAN="3"><input type=text name=pn size="10"></td>
</tr>
</table></center>
<center></form>
如果您修改了一个代码片段并且觉得很应该让别人共享,您可以把这作为这个代码片段的最新版本提交上来. |
|