寻找卓越网鼠标经过链接的时候出现一个DIV,触发这个事件的代码 如果分不够,可以再加,这是我在CSDN上面问的第一个问题,请高手们尽力回答,要是最后没有人回答,分我将扔大海去. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 很久很久以前有个同样的问题摆在我面前,我没有珍惜,等我失去的时候我才后悔莫及,人世间最痛苦的事莫过于此。现在同样的问题重现在我面前!不用再犹豫了!如果上天能够给我一个再来一次的机会,对这个帖子说:-----------------------------------------------------------------------------------<html><head><style type="text/css">.wc, #wc1, #wc2 { position:absolute; border-width:0px; z-index:2; left:0px; top:0px; display:none;}#wc1 { width:320px; height:240px; background-color:#FFCC00;}#wc2 { width:420px; height:340px; background-color:#CCCCCC;}.wc { z-index:1;}</style><script type="text/javascript">(function () { var interval = window.setInterval; window.setInterval = function (a, b) { var fun; if ("function" == typeof a) { var arg = Array.prototype.slice.call(arguments, 2); fun = function () { a.apply(null, arg); }; } else { fun = a; } return interval(fun, b); };})();function createOpenMenu(changeTime) { var intervalTime = 5, wc_number = 0; function addIframe() { //添加一个Iframe为了遮盖住IE的Select... var ifr = document.createElement("iframe"); ifr.setAttribute("id", "ifr_" + (++ wc_number)); ifr.setAttribute("className", "wc"); ifr.setAttribute("class", "wc"); document.body.appendChild(ifr); return $("ifr_" + wc_number); //返回新加入的Iframe... } function changeMenu(o) { //改变对象属性..以达到收缩效果... if (eval(o.bool)) { o.t_iframe.style.width = o.style.width = (o.t_num * o.t_width) + "px"; //设置Iframe和div的宽度.. o.t_iframe.style.height = o.style.height = (o.t_num * o.t_height) + "px"; //设置Ifrmae和div的高度.. o.t_iframe.style.left = o.style.left = o.t_left - o.offsetWidth / 2 + "px"; //设置Iframe和div的Left位置... } else { if (/</.test(o.bool)) { //如果是over的时候结束了的话,那么就显示内容.. o.innerHTML = o.context; } else { //否则就把Iframe和div隐藏... o.t_iframe.style.display = o.style.display = "none"; } window.clearInterval(o.timer); //清楚记时器 } } function over() { //当鼠标经过时..执行... var o = this.o; var par = this.p; o.bool = "++ o.t_num < changeTime"; //改变判断.. if (o.t_num <= 0 || "undefined" == typeof o.timer) { //如果记时器为空的时候 o.innerHTML = ""; //内容设置为空 o.t_iframe.style.display = o.style.display = "block"; //设置为显示 o.t_iframe.style.width = o.style.width = "0px"; o.t_iframe.style.height = o.style.height = "0px"; o.t_iframe.style.left = o.style.left = o.t_left - o.offsetWidth / 2 + "px"; //设置Iframe和div的left位置.. o.t_iframe.style.top = o.style.top = par.offsetTop + par.offsetHeight - 5 + "px"; //设置Iframe和div的top位置.. o.timer = window.setInterval(changeMenu, intervalTime, o); //建立记时器 } window.clearInterval(o.clear); } function out(o) { //当鼠标移开时..执行... o.bool = "-- o.t_num > 0"; //改变判断.. o.innerHTML = ""; if (o.t_num >= changeTime) { o.timer = window.setInterval(changeMenu, intervalTime, o); //建立记时器 } window.clearInterval(o.clear); } function execOut() { var o = this.o; o.clear = window.setInterval(out, 500, o); } this.add = function (to, eo) { //添加对象,设置一些参数... eo.t_num = 0; eo.t_iframe = addIframe(); eo.style.display = "block"; eo.t_left = to.offsetLeft + to.offsetWidth / 2; eo.t_width = (eo.offsetWidth) / changeTime; eo.t_height = (eo.offsetHeight) / changeTime; eo.style.display = "none"; eo.context = eo.innerHTML; to.o = eo.o = eo; to.p = eo.p = to; to.onmouseover = eo.onmouseover = over; to.onmouseout = eo.onmouseout = execOut; }}function $(id) { return document.getElementById(id);}window.onload = function () { var menu = new createOpenMenu(20); menu.add($("show_wc1"), $("wc1")); menu.add($("show_wc2"), $("wc2")); menu = null;}</script></head><body><div id="wc1">一:好多的内容的说......</div><div id="wc2">二:好多的内容的说......</div><center><button id="show_wc1">show_wc1</button><button id="show_wc2">show_wc2</button><br /><select style="width:150px;"></select></center></body></html>-----------------------------------------------------------------------------------如果非要说这个沉郁太多的话。。,我希望是LZ自己修改 2个功能的JS起冲突 求助JS,超链接的鼠标悬停效果 jquery slideUp的callback如何带参数阿 div oumouseout的使用问题????????? jquery autocomplete 哪里有的下 请教FF下的window.innerWidth在IE下是什么属性? 求这样一个时间选择联动效果~~ 怎样直接打开一个 .doc文挡?? 关于appendChild()的用法??? 如何制作网页上可自动下载并自动注册的控件? <td title="xx"> 其中xx可以是JS定义的变量吗,怎么引用? 新手问题:写的树状代码为何不执行?
-----------------------------------------------------------------------------------<html>
<head>
<style type="text/css">
.wc, #wc1, #wc2 {
position:absolute;
border-width:0px;
z-index:2;
left:0px;
top:0px;
display:none;
}
#wc1 {
width:320px;
height:240px;
background-color:#FFCC00;
}
#wc2 {
width:420px;
height:340px;
background-color:#CCCCCC;
}
.wc {
z-index:1;
}
</style>
<script type="text/javascript">
(function () {
var interval = window.setInterval;
window.setInterval = function (a, b) {
var fun;
if ("function" == typeof a) {
var arg = Array.prototype.slice.call(arguments, 2);
fun = function () {
a.apply(null, arg);
};
} else {
fun = a;
}
return interval(fun, b);
};
})();function createOpenMenu(changeTime) {
var intervalTime = 5, wc_number = 0; function addIframe() {
//添加一个Iframe为了遮盖住IE的Select...
var ifr = document.createElement("iframe");
ifr.setAttribute("id", "ifr_" + (++ wc_number));
ifr.setAttribute("className", "wc");
ifr.setAttribute("class", "wc");
document.body.appendChild(ifr);
return $("ifr_" + wc_number); //返回新加入的Iframe...
}
function changeMenu(o) {
//改变对象属性..以达到收缩效果...
if (eval(o.bool)) {
o.t_iframe.style.width = o.style.width = (o.t_num * o.t_width) + "px"; //设置Iframe和div的宽度..
o.t_iframe.style.height = o.style.height = (o.t_num * o.t_height) + "px"; //设置Ifrmae和div的高度..
o.t_iframe.style.left = o.style.left = o.t_left - o.offsetWidth / 2 + "px"; //设置Iframe和div的Left位置...
} else {
if (/</.test(o.bool)) { //如果是over的时候结束了的话,那么就显示内容..
o.innerHTML = o.context;
} else { //否则就把Iframe和div隐藏...
o.t_iframe.style.display = o.style.display = "none";
}
window.clearInterval(o.timer); //清楚记时器
}
}
function over() {
//当鼠标经过时..执行...
var o = this.o;
var par = this.p;
o.bool = "++ o.t_num < changeTime"; //改变判断..
if (o.t_num <= 0 || "undefined" == typeof o.timer) { //如果记时器为空的时候
o.innerHTML = ""; //内容设置为空
o.t_iframe.style.display = o.style.display = "block"; //设置为显示
o.t_iframe.style.width = o.style.width = "0px";
o.t_iframe.style.height = o.style.height = "0px";
o.t_iframe.style.left = o.style.left = o.t_left - o.offsetWidth / 2 + "px"; //设置Iframe和div的left位置..
o.t_iframe.style.top = o.style.top = par.offsetTop + par.offsetHeight - 5 + "px"; //设置Iframe和div的top位置..
o.timer = window.setInterval(changeMenu, intervalTime, o); //建立记时器
}
window.clearInterval(o.clear);
}
function out(o) {
//当鼠标移开时..执行...
o.bool = "-- o.t_num > 0"; //改变判断..
o.innerHTML = "";
if (o.t_num >= changeTime) {
o.timer = window.setInterval(changeMenu, intervalTime, o); //建立记时器
}
window.clearInterval(o.clear);
}
function execOut() {
var o = this.o;
o.clear = window.setInterval(out, 500, o);
}
this.add = function (to, eo) {
//添加对象,设置一些参数...
eo.t_num = 0;
eo.t_iframe = addIframe();
eo.style.display = "block";
eo.t_left = to.offsetLeft + to.offsetWidth / 2;
eo.t_width = (eo.offsetWidth) / changeTime;
eo.t_height = (eo.offsetHeight) / changeTime;
eo.style.display = "none";
eo.context = eo.innerHTML;
to.o = eo.o = eo;
to.p = eo.p = to;
to.onmouseover = eo.onmouseover = over;
to.onmouseout = eo.onmouseout = execOut;
}
}
function $(id) {
return document.getElementById(id);
}
window.onload = function () {
var menu = new createOpenMenu(20);
menu.add($("show_wc1"), $("wc1"));
menu.add($("show_wc2"), $("wc2"));
menu = null;
}
</script>
</head>
<body>
<div id="wc1">一:好多的内容的说......</div>
<div id="wc2">二:好多的内容的说......</div>
<center>
<button id="show_wc1">show_wc1</button>
<button id="show_wc2">show_wc2</button>
<br />
<select style="width:150px;"></select>
</center>
</body>
</html>-----------------------------------------------------------------------------------
如果非要说这个沉郁太多的话。。,我希望是LZ自己修改