Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
法1:使用onclick事件
<input type="button" value="按鈕" onclick="javascrtpt:window.location. />
或者直接使用button標(biāo)簽
<button onclick="window.location.>百度</button>
方法2:在button標(biāo)簽外套一個(gè)a標(biāo)簽
<a > <button>百度</button> </a>
或使用
<a ><input type="button" value='百度'></a>
方法3:使用JavaScript函數(shù)
信
51rgb
網(wǎng)頁自動跳轉(zhuǎn)頁面的代碼在很多時(shí)候都非常的有用,下面的是兩個(gè)簡單的例子。僅供參考。
方案一,用<meta>里直接寫刷新語句:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta http-equiv="refresh" content="5;url=http://www.51rgb.com">
<title>html網(wǎng)頁自動跳轉(zhuǎn)代碼--西農(nóng)大網(wǎng)站</title>
</head>
<body>
測試:html網(wǎng)頁自動跳轉(zhuǎn)代碼<br/>
你可以在這里寫下你想的一切東西!<br />
如:西北農(nóng)林科技大學(xué)是一所985、211院校。<br />
</body></html>
方案二,用javascript腳本來跳轉(zhuǎn)
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>正在進(jìn)入西農(nóng)大網(wǎng)站</title>
</head>
<body>
<form name=loading>
<p align=center> <font color="#0066ff" size="2">正在進(jìn)入,請稍等</font><font color="#0066ff" size="2" face="Arial">...</font>
<input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">
<inputtype=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">
<script>
var bar=0
var line="||"
var amount="||"
count
function count{
bar=bar+2
amount =amount + line
document.loading.chart.value=amount
document.loading.percent.value=bar+"%"
if (bar<99)
{setTimeout("count",100);}
else
{window.location =http://www.51rgb.com;}
}</script>
</p>
</form><p align="center">
測試:html網(wǎng)頁自動跳轉(zhuǎn)代碼<br/>
你可以在這里寫下你想的一切東西!<br />
如:西北農(nóng)林科技大學(xué)是一所985、211院校。<br /><br />
如果您的瀏覽器不支持跳轉(zhuǎn),<astyle="text-decoration: none" ><font color="#FF0000">請點(diǎn)這里</font></a>.</p>
</body>
</html>
↓↓↓
我們在瀏覽一個(gè)網(wǎng)頁的時(shí)候,通常會遇到比較長的網(wǎng)頁,一直向下拉滾動條一直向下,而在最底部的位置通常會有一個(gè)一鍵返回到頂部
或者返回到哪里的按鈕,這個(gè)按鈕就是利用的 錨點(diǎn)鏈接 功能。
就兩個(gè)值:第一個(gè)就是錨點(diǎn)下在哪里?第二個(gè)就是點(diǎn)在哪里?
<body>
<!-- 2、跳轉(zhuǎn)的目標(biāo)位置:點(diǎn)-->
<a id="test">這里是頂部</a>
<!-- 1、跳轉(zhuǎn)的按鈕:錨-->
<a href="#test">回到頂部</a>
</body>
源代碼:↓
備注:如果手機(jī)上看格式錯(cuò)亂,建議粘貼到電腦版編輯器里觀看。
*請認(rèn)真填寫需求信息,我們會在24小時(shí)內(nèi)與您取得聯(lián)系。