<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>留言板頭像選擇代碼-懶人圖庫</title>
<style type="text/css">
.on{margin:5px;border:1px solid #F60;filter:alpha(Opacity=100)}
.off{margin:5px;border:1px solid #CCC;filter:alpha(Opacity=20)}
</style>
</head>
<body>
<script language="javascript">
function aa(a, b, c) {
document.form1.img.value = a;
document.getElementById("touxiang").getElementsByTagName("img")[a - 1].className = "on";
document.getElementById("touxiang").getElementsByTagName("img")[b - 1].className = "off";
document.getElementById("touxiang").getElementsByTagName("img")[c - 1].className = "off";
}
function Check(x) {
for (i = 1; i <= 1; i++) document.all.img.value = x
}
</script>
<div id="touxiang">
<a href="#"><img border="0" src="http://www.lanrentuku.com/down/js/images/12625057550.gif" name=01 onclick=aa(1,2,3,4);Check(this.name,"") class="off"></a>
<a href="#"><img border="0" src="http://www.lanrentuku.com/down/js/images/12625057551.gif" name=02 onclick=aa(2,1,3,4);Check(this.name,"") class="off"></a>
<a href="#"><img border="0" src="http://www.lanrentuku.com/down/js/images/12625057552.gif" name=03 onclick=aa(3,1,2,4);Check(this.name,"") class="off"></a>
<form name="form1">
<input type=text name=img value="01">
</form>
<p>用圖片代替Radio框選擇value值,效果還不錯,可以用作留言板圖像選擇按鈕。</p>
<p>filter濾鏡在Firefox下無效,但border起作用~</p>
<p>演示:<a target="_blank" >http://www.maitianquan.com/plus/guestbook.php</a></p>
<p>作者:<a target="_blank">西西</a></p> 尊重他人勞動,轉載請保留出處!
<p>查找更多代碼,請訪問:<a target="_blank">懶人圖庫</a></p>
</body>
</html>
建站咨詢
如您有網站建設方面的需要,歡迎給我們留言或在線咨詢 *