返回   CHF站长论坛 > 综合讨论区 > 谈天说地

谈天说地 论坛就是大家的家,一家人有什么不能说的?

双至强仅二千,企商在线,最早租用商 传世私服 魔域私服 亿恩1元帮您升级服务器! 天龙八部私服 传奇世界私服
传奇私服 仙境私服 天龙八部私服 传奇私服 传世私服 完美世界私服 魔域私服 传奇私服
发表新主题 回复
 
主题工具 主题评分 显示模式
旧 2008-07-01, 14:32   #1 (页面定位)
Ulysses©
不学无术
 
Ulysses 的头像
 
注册日期: 2006-02-05
住址: 地狱18层
帖子: 7779
Ulysses 的声望功能已被禁用
默认 谁可以编写一段 JavaScript 呢?

实现目标:点击链接,显示下拉菜单效果。

如同点击论坛上面的“搜索”和“快速链接”,以求尽可能通用。


Blog 暂时关闭中,不便之处,见谅!

Dear god,
I know that she's out there, the one I'm suppose to share my whole life with.
And in time, you'll show her to me.
Will you take care of her, comfort her, and protect her until that day we meet.
And let her know, my heart is beating with hers.
Ulysses 当前离线   回复时引用此帖
旧 2008-07-01, 14:36   #2 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

我看蓝色理想有个的


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 14:36   #3 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

那人是要QQ中转站那个点击下载,弹出一个小页面。


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 15:01   #4 (页面定位)
Ulysses©
不学无术
 
Ulysses 的头像
 
注册日期: 2006-02-05
住址: 地狱18层
帖子: 7779
Ulysses 的声望功能已被禁用
默认

有地址?


Blog 暂时关闭中,不便之处,见谅!

Dear god,
I know that she's out there, the one I'm suppose to share my whole life with.
And in time, you'll show her to me.
Will you take care of her, comfort her, and protect her until that day we meet.
And let her know, my heart is beating with hers.
Ulysses 当前离线   回复时引用此帖
旧 2008-07-01, 15:19   #5 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

不记得了


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 15:19   #6 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

我看看我有没有保存


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 15:21   #7 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

看看这个行么?

代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Untitled Document</title>
		<style type="text/css">
			#keleSelect{
				TEXT-DECORATION: none;
			}
			body {
				margin:0;
				padding:0;
			}
		</style>
		<script type="text/javascript" >
			var ary = new Array;
			var tableAlign = "left" // left|right
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"回复所有人"
			}) ;
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"转发"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"打印"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"将 rubyonrails-spinoffs 添加到通讯录"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"删除此邮件"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"这是网络欺诈"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"显示原始邮件"
			});
			ary.push( {
				img:"",
				url:"http://www.kele-cn.cn",
				title:"邮件内容出现乱码?"
			});
			function addOnLoad(newFunction) {
				var oldFun = window.onload;
				if(typeof window.onload != "function") {
					window.onload = newFunction;
				}else {
					window.onload = function() {
						oldFun();
						newFunction();
					}
				}
			}
			function trOnclick(obj) {
				var keleKey = document.getElementById("keleKey");
				var url = ary[obj.i].url + "?key=" + keleKey.value;
				location.href = url;
			}
			function prepareKeleTable() {
				var keleTr = document.getElementById("keleTable").getElementsByTagName("tr");
				var trCount = keleTr.length
				for(var i=0;i<trCount;++i) {
				keleTr[i].onmouseout = function() {this.style.backgroundColor = "#EEEEEE";};
				keleTr[i].onmouseover = function() {this.style.backgroundColor = "#CCCCCC";};
				keleTr[i].onclick = function(){ trOnclick(this); }
				}
			}
			/**
			 * 
			 * @param {Object} table
			 * @info 设置table样式
			 */
			function keleSelectStyle(obj,table) {
				table.style.border = "#CCCCCC solid 1px";
				table.style.backgroundColor = "#EEEEEE";
				table.style.color="#496397";
				table.style.borderCollapse="collapse";
				table.style.fontFamily = "arial,sans-serif";
				table.style.fontSize = "14px";
				table.style.lineHeight="20px";
				table.style.position = "absolute";
				table.style.top = obj["offsetHeight"]+ calculateOffsetTop(obj) + "px";
				if (tableAlign == "left") {
					table.style.left = calculateOffsetLeft(obj) + "px";
				} else {
					table.style.right = document.body.offsetWidth - calculateOffsetLeft(obj) -obj.offsetWidth  + "px";
				}
			}
 			function keleSelectOnclick(obj){
                                     clearTable();
				var table = document.createElement("table");
				table.setAttribute("id","keleTable");
				keleSelectStyle(obj,table);
				var tbody = document.createElement("tbody");
				for(var i=0;i<ary.length;++i) {
					var tr = document.createElement("tr");
					tr.i = i;
					var td1 = document.createElement("td");
					var td2 = createTd(ary[i].title);
					var img = createImg(ary[i].img);
					td1.style.padding = "1px";
					td1.width = "18px";
					td1.appendChild(img);
					td2.style.padding = "1px";
					tr.appendChild(td1);
					tr.appendChild(td2);
					tr.style.cursor = "pointer";
					tbody.appendChild(tr);
				}
				table.appendChild(tbody);
				document.body.appendChild(table);
				prepareKeleTable();
				
				/*
				if(document.getElementById("keleTable")) {
					alert("yes");
					alert(document.getElementById("keleTable").innerHTML);
				} else {
					alert("no");
				}
				*/
			}
			function prepareKeleSelect() {
			 var keleSelect = document.getElementById("keleSelect");
			 keleSelect.onblur = function() { setTimeout("clearTable()",100);}
			 keleSelect.onclick = function() { keleSelectOnclick(this); return false;};
			 
			}
			function calculateOffsetLeft(field) {
				return calculateOffset(field,"offsetLeft");
			}
			function calculateOffsetTop(field) {
				return calculateOffset(field,"offsetTop");
			}
			function calculateOffset(field,attr) {
				if(field) {
					return field[attr] + calculateOffset(field.offsetParent, attr);
				} else {
					return 0;
				}
			}
			function clearTable() {
				if(!document.getElementById("keleTable")) return false;
				var keleTable = document.getElementById("keleTable");
				document.body.removeChild(keleTable);
			}
			function createTd(text){
				var td = document.createElement("td");
				var textNode = document.createTextNode(text);
				td.appendChild(textNode);
				
				return  td;
			}
			function createImg(url) {
				if (url != "") {
					var img = document.createElement("img");
					img.setAttribute("src", url);
					return img;
				} else {
					var text = document.createTextNode(" ");
					return text;
				}
			}
			addOnLoad(prepareKeleSelect);
		</script>
	</head>
	<body>
	<div style="margin:0 auto;text-align:center;">
		<h1><a id="keleSelect" href="#"></>OnClick</a></h1>
		<input type="hidden" id="keleKey" name="keleKey" value="KeleKeyyyyyyyy">
	</div>
	</body>
</html>


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 15:25   #8 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

那个QQ,我没保存


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 15:27   #9 (页面定位)
Kevin_Zhou©
 
Kevin_Zhou 的头像
 
注册日期: 2005-10-23
帖子: 10638
Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星Kevin_Zhou 绝对是天王巨星
默认

js我只会乱改!!看都不一定能看懂~
Kevin_Zhou 当前离线   回复时引用此帖
旧 2008-07-01, 15:39   #10 (页面定位)
Ulysses©
不学无术
 
Ulysses 的头像
 
注册日期: 2006-02-05
住址: 地狱18层
帖子: 7779
Ulysses 的声望功能已被禁用
默认

A君那段代码,我看过了,效果差不多,但是不太符合我的要求。

其实我自己都收集了微软的,但是不喜欢。

http://www.purewhite.cn/demo/20061214001/


Blog 暂时关闭中,不便之处,见谅!

Dear god,
I know that she's out there, the one I'm suppose to share my whole life with.
And in time, you'll show her to me.
Will you take care of her, comfort her, and protect her until that day we meet.
And let her know, my heart is beating with hers.
Ulysses 当前离线   回复时引用此帖
旧 2008-07-01, 15:59   #11 (页面定位)
A君©
萌爸
 
A君 的头像
 
注册日期: 2005-08-31
住址: Chin@Net
帖子: 17024
A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就A君 有着超越历史的辉煌成就
默认

不懂这些东西


QQ:382121

A君 当前离线   回复时引用此帖
旧 2008-07-01, 17:48   #12 (页面定位)
junp
 
junp 的头像
 
注册日期: 2005-11-06
帖子: 126
junp 是普普通通的会员
默认

就用论坛上面那个
junp 当前离线   回复时引用此帖
旧 2008-07-01, 18:01   #13 (页面定位)
recycle
 
recycle 的头像
 
注册日期: 2005-09-25
住址: Gz
帖子: 1876
recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星recycle 是一位成功的新星
默认

自己多看几个页面,喜欢的就拷下来。


好好学习 ,天天向上!
recycle 当前离线   回复时引用此帖
回复

书签

标签

主题工具
显示模式 对此主题评分
对此主题评分:



所有时间均为北京时间。现在的时间是 18:22