select下拉列表框总在最上层,请问该怎么办呀? ie 下的select是很特殊的,或许你只能用层模拟一个select了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在层中加一个iframe<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100px; height:200px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""></HEAD><BODY><TABLE WIDTH=300 BORDER=1 CELLPADDING=1 CELLSPACING=1 bordercolor='#FFFFFF' bgcolor='lightblue' style='cursor:hand'><TR><TD onmouseover="showMenu(this,'´ó²Ë11,´ó²Ë12,´ó²Ë13'); ">Ö÷²Ë1</TD><TD onmouseover="showMenu(this,'´ó²Ë21,´ó²Ë22' );">Ö÷²Ë2</TD><TD onmouseover="showMenu(this,'´ó²Ë31,´ó²Ë32'); ">Ö÷²Ë3</TD></TR></TABLE><select><option>A</option><option>B</option><option>C</option></select><SCRIPT>var oPopup = window.createPopup();function showMenu(obj,S){var oPopBody ,rows,Arr;var oPopBody = oPopup.document.body;oPopBody.style.backgroundColor = "lightblue";oPopBody.style.border = "solid #eeeeee 1px";Arr=S.split(",");oPopBody.innerHTML = HTML(Arr);rows=Arr.length;oPopup.show(obj.offsetLeft + 10, obj.offsetTop + 40, 105, rows * 31, document.body) ;}function HTML(A){var str="<TABLE WIDTH=300 BORDER=1 CELLPADDING=1 CELLSPACING=1 bordercolor='#FFFFFF' bgcolor='lightblue' style='cursor:hand'>";for (StrA in A){str+="<TR><TD>" + A[StrA] + "</TD></TR>" ;}str+= "</TABLE>" ;return(str);}</SCRIPT></BODY></HTML> select和object都不受控制的,除了用iframe,还可以用隐藏select和object对象的方法。var leftX=0, rightX=0, topY=0, bottomY=0;function calculateSumOffset(idItem, offsetName) { var totalOffset = 0; var item = eval('idItem'); do { totalOffset += eval('item.'+offsetName); item = eval('item.offsetParent'); } while (item != null); return totalOffset;}function hideElement(elmID) { for (i = 0; i < document.all.tags(elmID).length; i++) { obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = calculateSumOffset(obj, 'offsetLeft'); objTop = calculateSumOffset(obj, 'offsetTop'); if (leftX > (objLeft + obj.offsetWidth) || objLeft > rightX) ; else if (topY> (objTop + obj.offsetHeight) || objTop > bottomY || ) ; else obj.style.visibility = "hidden"; }}function showElement(elmID) { for (i = 0; i < document.all.tags(elmID).length; i++) { obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; obj.style.visibility = ""; }}function hideAll() { hideElement("SELECT"); hideElement("OBJECT");}function showAll() { showElement("SELECT"); showElement("OBJECT");} 这段代码可以把leftX, rightX, topY, bottomY范围内的SELECT和OBJECT隐藏,不过隐藏后记得要还原回来喔var leftX=0, rightX=0, topY=0, bottomY=0;function calculateSumOffset(idItem, offsetName) { var totalOffset = 0; var item = eval('idItem'); do { totalOffset += eval('item.'+offsetName); item = eval('item.offsetParent'); } while (item != null); return totalOffset;}function hideElement(elmID) { for (i = 0; i < document.all.tags(elmID).length; i++) { obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = calculateSumOffset(obj, 'offsetLeft'); objTop = calculateSumOffset(obj, 'offsetTop'); if (leftX > (objLeft + obj.offsetWidth) || objLeft > rightX) ; else if (topY> (objTop + obj.offsetHeight) || objTop > bottomY) ; else obj.style.visibility = "hidden"; }}function showElement(elmID) { for (i = 0; i < document.all.tags(elmID).length; i++) { obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; obj.style.visibility = ""; }}function hideAll() { hideElement("SELECT"); hideElement("OBJECT");}function showAll() { showElement("SELECT"); showElement("OBJECT");} 自动填写出错 在学习JS之前!学下HTML呢还是XHTML? 求教span挨个循环显示 这句话是什么意思? js读取cookies时中文变成乱码,请求解决方法 请问能实现手动控制超级连接的有效无效吗? 看这段javascript代码,很奇怪,为什么会出错呢? 如何在左框架中控制右框架中滚动条的出现? 下面的代码不起作用: 需要一段网页自动刷新的代码 如何隐去IE上方的菜单栏? 请问一下 怎么在拖动浏览器大小的时候... 可个根据对应索引获得对象吗?
<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100px; height:200px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<TABLE WIDTH=300 BORDER=1 CELLPADDING=1 CELLSPACING=1 bordercolor='#FFFFFF' bgcolor='lightblue' style='cursor:hand'>
<TR>
<TD onmouseover="showMenu(this,'´ó²Ë11,´ó²Ë12,´ó²Ë13'); ">Ö÷²Ë1</TD>
<TD onmouseover="showMenu(this,'´ó²Ë21,´ó²Ë22' );">Ö÷²Ë2</TD>
<TD onmouseover="showMenu(this,'´ó²Ë31,´ó²Ë32'); ">Ö÷²Ë3</TD>
</TR>
</TABLE>
<select>
<option>A</option>
<option>B</option>
<option>C</option>
</select><SCRIPT>
var oPopup = window.createPopup();
function showMenu(obj,S)
{
var oPopBody ,rows,Arr;
var oPopBody = oPopup.document.body;
oPopBody.style.backgroundColor = "lightblue";
oPopBody.style.border = "solid #eeeeee 1px";
Arr=S.split(",");
oPopBody.innerHTML = HTML(Arr);
rows=Arr.length;
oPopup.show(obj.offsetLeft + 10, obj.offsetTop + 40, 105, rows * 31, document.body) ;
}
function HTML(A)
{
var str="<TABLE WIDTH=300 BORDER=1 CELLPADDING=1 CELLSPACING=1 bordercolor='#FFFFFF' bgcolor='lightblue' style='cursor:hand'>";
for (StrA in A)
{
str+="<TR><TD>" + A[StrA] + "</TD></TR>" ;
}
str+= "</TABLE>" ;
return(str);
}
</SCRIPT>
</BODY>
</HTML>
var totalOffset = 0;
var item = eval('idItem');
do {
totalOffset += eval('item.'+offsetName);
item = eval('item.offsetParent');
} while (item != null);
return totalOffset;
}function hideElement(elmID) {
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue; // Find the element's offsetTop and offsetLeft relative to the BODY tag.
objLeft = calculateSumOffset(obj, 'offsetLeft');
objTop = calculateSumOffset(obj, 'offsetTop'); if (leftX > (objLeft + obj.offsetWidth) || objLeft > rightX) ;
else if (topY> (objTop + obj.offsetHeight) || objTop > bottomY || ) ;
else obj.style.visibility = "hidden";
}
}function showElement(elmID) {
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue;
obj.style.visibility = "";
}
}function hideAll() {
hideElement("SELECT");
hideElement("OBJECT");
}function showAll() {
showElement("SELECT");
showElement("OBJECT");
}
var totalOffset = 0;
var item = eval('idItem');
do {
totalOffset += eval('item.'+offsetName);
item = eval('item.offsetParent');
} while (item != null);
return totalOffset;
}function hideElement(elmID) {
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue; // Find the element's offsetTop and offsetLeft relative to the BODY tag.
objLeft = calculateSumOffset(obj, 'offsetLeft');
objTop = calculateSumOffset(obj, 'offsetTop'); if (leftX > (objLeft + obj.offsetWidth) || objLeft > rightX) ;
else if (topY> (objTop + obj.offsetHeight) || objTop > bottomY) ;
else obj.style.visibility = "hidden";
}
}function showElement(elmID) {
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue;
obj.style.visibility = "";
}
}function hideAll() {
hideElement("SELECT");
hideElement("OBJECT");
}function showAll() {
showElement("SELECT");
showElement("OBJECT");
}