<input type="text" id="zqgztext" size="14" value='<bean:write name="zqgzgmc"/>' onfocus="inputTree(zqgz,zqgzmenu)" readonly="true">时调查用以下JS请帮忙!~
document.write("<div id=meizzTreeInputLayer style='position: absolute; z-index: 9999; width: 150; height: 150; display: none'>");
document.write("<iframe name=meizzTreeInputIframe scrolling=auto style='border:1px #999999 solid' width=100% height=100%></iframe></div>");
function writeTreeIframe(selectmenu)
{
var strIframe = '<link rel ="stylesheet" type="text/css" href="css/style.css"><html><head>'+
"</head><body bgcolor='#CCCCCC' style='margin:0px' oncontextmenu='return false'>"+
"<table border='0' bgcolor='#FFFFFF' bordercolorlight='#000000' bordercolordark='#FFFFFF' width='100%' height='100%'>"+
'<tr><TD valign="top">'+selectmenu.innerHTML+'</td></tr>'+
'<tr><TD> </td></tr>'+
"</table></body></html>"; with(TreeInput.iframe)
{
document.writeln(strIframe); document.close();
}
}
function getObjectById(id){if(document.all) return(eval("document.all."+ id)); return(eval(id)); }
function hiddenTreeInput(){getObjectById("meizzTreeInputLayer").style.display = "none";};
function returnItem(returnid,returntext) //
{
//var returnValue=divtext.innerHTML;
TreeInput.objExport.value = returnid;
TreeInput.textExport.value = returntext.innerHTML;
hiddenTreeInput();
}function TreeInput() //初始化日历的设置
{
this.regInfo = "";
this.regInfo += "";
this.iframe = window.frames("meizzTreeInputIframe"); // iframe 载体
this.TreeInput = getObjectById("meizzTreeInputLayer"); //层
this.objExport = null;
this.textExport = null;
}
var TreeInput = new TreeInput();
function inputTree(colname,selectmenu) //主调函数
{
var e = window.event.srcElement;
writeTreeIframe(selectmenu);
var o = TreeInput.TreeInput.style; TreeInput.eventSrc = e;
if (arguments.length == 0) {
TreeInput.objExport = e;
}
else{
TreeInput.objExport = eval(arguments[0]);
TreeInput.textExport = e;
} var t = e.offsetTop, h = e.clientHeight, l = e.offsetLeft, p = e.type;
while (e = e.offsetParent){t += e.offsetTop; l += e.offsetLeft;}
o.display = ""; TreeInput.iframe.document.body.focus();
var cw = TreeInput.TreeInput.clientWidth, ch = TreeInput.TreeInput.clientHeight;
var dw = document.body.clientWidth, dl = document.body.scrollLeft, dt = document.body.scrollTop;
if (document.body.clientHeight + dt - t - h >= ch) o.top = (p=="image")? t + h : t + h + 6;
else o.top = (t - dt < ch) ? ((p=="image")? t + h : t + h + 6) : t - ch;
if (dw + dl - l >= cw) o.left = l; else o.left = (dw >= cw) ? dw - cw + dl : dl;
}
document.write("<div id=meizzTreeInputLayer style='position: absolute; z-index: 9999; width: 150; height: 150; display: none'>");
document.write("<iframe name=meizzTreeInputIframe scrolling=auto style='border:1px #999999 solid' width=100% height=100%></iframe></div>");
function writeTreeIframe(selectmenu)
{
var strIframe = '<link rel ="stylesheet" type="text/css" href="css/style.css"><html><head>'+
"</head><body bgcolor='#CCCCCC' style='margin:0px' oncontextmenu='return false'>"+
"<table border='0' bgcolor='#FFFFFF' bordercolorlight='#000000' bordercolordark='#FFFFFF' width='100%' height='100%'>"+
'<tr><TD valign="top">'+selectmenu.innerHTML+'</td></tr>'+
'<tr><TD> </td></tr>'+
"</table></body></html>"; with(TreeInput.iframe)
{
document.writeln(strIframe); document.close();
}
}
function getObjectById(id){if(document.all) return(eval("document.all."+ id)); return(eval(id)); }
function hiddenTreeInput(){getObjectById("meizzTreeInputLayer").style.display = "none";};
function returnItem(returnid,returntext) //
{
//var returnValue=divtext.innerHTML;
TreeInput.objExport.value = returnid;
TreeInput.textExport.value = returntext.innerHTML;
hiddenTreeInput();
}function TreeInput() //初始化日历的设置
{
this.regInfo = "";
this.regInfo += "";
this.iframe = window.frames("meizzTreeInputIframe"); // iframe 载体
this.TreeInput = getObjectById("meizzTreeInputLayer"); //层
this.objExport = null;
this.textExport = null;
}
var TreeInput = new TreeInput();
function inputTree(colname,selectmenu) //主调函数
{
var e = window.event.srcElement;
writeTreeIframe(selectmenu);
var o = TreeInput.TreeInput.style; TreeInput.eventSrc = e;
if (arguments.length == 0) {
TreeInput.objExport = e;
}
else{
TreeInput.objExport = eval(arguments[0]);
TreeInput.textExport = e;
} var t = e.offsetTop, h = e.clientHeight, l = e.offsetLeft, p = e.type;
while (e = e.offsetParent){t += e.offsetTop; l += e.offsetLeft;}
o.display = ""; TreeInput.iframe.document.body.focus();
var cw = TreeInput.TreeInput.clientWidth, ch = TreeInput.TreeInput.clientHeight;
var dw = document.body.clientWidth, dl = document.body.scrollLeft, dt = document.body.scrollTop;
if (document.body.clientHeight + dt - t - h >= ch) o.top = (p=="image")? t + h : t + h + 6;
else o.top = (t - dt < ch) ? ((p=="image")? t + h : t + h + 6) : t - ch;
if (dw + dl - l >= cw) o.left = l; else o.left = (dw >= cw) ? dw - cw + dl : dl;
}
解决方案 »
- 变量作用域
- 帮忙给个合理解释
- JavaScript源码分析 高手群(84507704) 欢迎加入!!研究Js面向对象 jQuery Extjs
- JS高手请进
- 当鼠标滑过一个链接时,怎样得到这个链接的地址,并用alert弹出?前提是不能对这个链接做手脚
- js中 关于this的一段代码看不透,求解!!!
- 有几个函数的看不懂,请问具体是什么意思?
- 如何得到<select>中的值,即<option value="1">浙江</option>中的 浙江
- 如何确保页面刷新时不会用cache里面的值
- 百度地图多个polyline添加mouseover事件显示infowindow的问题
- 请问下列一条语句的含义
- 急急急急~一个简单的jsp问题~~~~~~~~~~~~~~~~~~帮我看看吧~
对于日期时间控件baidu下 很多