这个JS哪里出错了,为什么在火狐显示不了
functionmakeSelectBox(thisId){varoptionMaxNum=7;//varoptionInnerLayerHeight="";varobj...
function makeSelectBox(thisId) {
var optionMaxNum = 7; //
var optionInnerLayerHeight = "";
var objID = thisId;
var obj = document.getElementById(objID);
var selectBoxWidth = parseInt(obj.style.width);
var selectBoxHeight = parseInt(obj.style.height);
if (obj.options.length > optionMaxNum) optionInnerLayerHeight = "height:"+ (optionMaxNum) + "px";
newSelect = "<table id='" + objID + "selectBoxOptionLayer' cellpadding='0' cellspacing='0' border='0' style='position:absolute;width:69px;display:none;margin-top:-1px;' onMouseOver=\"viewOptionLayer('"+ objID + "')\" onMouseOut=\"setMousePosition('out')\">";
newSelect += " <tr>";
newSelect += " <td height='" + selectBoxHeight + "' style='cursor:pointer;' onClick=\"hideOptionLayer('"+ objID + "')\"></td>";
newSelect += " </tr>";
newSelect += " <tr>";
newSelect += " <td style='text-align:left'>";
newSelect += " <div class='selectsel'>";
newSelect += " <table cellpadding='0' cellspacing='0' border='0' width='100%'>";
for (var i=0 ; i < obj.options.length ; i++) {
var nowValue = obj.options[i].value;
var nowText = obj.options[i].text;
newSelect += " <tr>";
newSelect += " <td onMouseOver=this.style.backgroundColor='#FFBA00';return true; onMouseOut=this.style.backgroundColor='#f7f7f7';return true; bgcolor=#f7f7f7 onClick=\"selectThisValue('"+ objID + "'," + i + ",'" + nowValue + "','" + nowText + "')\" style='cursor:pointer;padding-top: 2px' >" + nowText + "</td>";
newSelect += " <input type='hidden' id='"+ objID + "SelectBoxOptionValue" + i + "' value='" + nowValue + "'>";
newSelect += " </tr>";
}
newSelect += " </table>";
newSelect += " </div>";
newSelect += " </td>";
newSelect += " </tr>";
newSelect += "</table>";
newSelect += "<table cellpadding='0' cellspacing='0' border='0' onClick=\"viewOptionLayer('"+ objID + "')\" style='cursor:pointer;'>";
newSelect += " <tr>";
newSelect += " <td class='selectbox'>";
newSelect += " <div id='" + objID + "Value'></div>";
newSelect += " </td>";
newSelect += " </tr>";
newSelect += "</table>";
document.write(newSelect);
var haveSelectedValue = false;
for (var i=0 ; i < obj.options.length ; i++) {
if (obj.options[i].selected == true) {
haveSelectedValue = true;
settingValue(objID,obj.options[i].text);
}
}
if (!haveSelectedValue) settingValue(objID,obj.options[0].text);
}
document.onmousedown = clickMouse;
newSelect += " <div id='" + objID + "Value'></div>"; 这句就是在火狐显示不了,在IE正常 展开
var optionMaxNum = 7; //
var optionInnerLayerHeight = "";
var objID = thisId;
var obj = document.getElementById(objID);
var selectBoxWidth = parseInt(obj.style.width);
var selectBoxHeight = parseInt(obj.style.height);
if (obj.options.length > optionMaxNum) optionInnerLayerHeight = "height:"+ (optionMaxNum) + "px";
newSelect = "<table id='" + objID + "selectBoxOptionLayer' cellpadding='0' cellspacing='0' border='0' style='position:absolute;width:69px;display:none;margin-top:-1px;' onMouseOver=\"viewOptionLayer('"+ objID + "')\" onMouseOut=\"setMousePosition('out')\">";
newSelect += " <tr>";
newSelect += " <td height='" + selectBoxHeight + "' style='cursor:pointer;' onClick=\"hideOptionLayer('"+ objID + "')\"></td>";
newSelect += " </tr>";
newSelect += " <tr>";
newSelect += " <td style='text-align:left'>";
newSelect += " <div class='selectsel'>";
newSelect += " <table cellpadding='0' cellspacing='0' border='0' width='100%'>";
for (var i=0 ; i < obj.options.length ; i++) {
var nowValue = obj.options[i].value;
var nowText = obj.options[i].text;
newSelect += " <tr>";
newSelect += " <td onMouseOver=this.style.backgroundColor='#FFBA00';return true; onMouseOut=this.style.backgroundColor='#f7f7f7';return true; bgcolor=#f7f7f7 onClick=\"selectThisValue('"+ objID + "'," + i + ",'" + nowValue + "','" + nowText + "')\" style='cursor:pointer;padding-top: 2px' >" + nowText + "</td>";
newSelect += " <input type='hidden' id='"+ objID + "SelectBoxOptionValue" + i + "' value='" + nowValue + "'>";
newSelect += " </tr>";
}
newSelect += " </table>";
newSelect += " </div>";
newSelect += " </td>";
newSelect += " </tr>";
newSelect += "</table>";
newSelect += "<table cellpadding='0' cellspacing='0' border='0' onClick=\"viewOptionLayer('"+ objID + "')\" style='cursor:pointer;'>";
newSelect += " <tr>";
newSelect += " <td class='selectbox'>";
newSelect += " <div id='" + objID + "Value'></div>";
newSelect += " </td>";
newSelect += " </tr>";
newSelect += "</table>";
document.write(newSelect);
var haveSelectedValue = false;
for (var i=0 ; i < obj.options.length ; i++) {
if (obj.options[i].selected == true) {
haveSelectedValue = true;
settingValue(objID,obj.options[i].text);
}
}
if (!haveSelectedValue) settingValue(objID,obj.options[0].text);
}
document.onmousedown = clickMouse;
newSelect += " <div id='" + objID + "Value'></div>"; 这句就是在火狐显示不了,在IE正常 展开
2个回答
展开全部
您好!很高兴为您答疑!
建议安装Firebug调试下,它集HTML查看和编辑、Javascript控制台、网络状况监视器于一体,是开发JavaScript、CSS、HTML和Ajax的得力助手。
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
建议安装Firebug调试下,它集HTML查看和编辑、Javascript控制台、网络状况监视器于一体,是开发JavaScript、CSS、HTML和Ajax的得力助手。
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2008-12-31
展开全部
看看你的FIREFOX 的XACTIVE设置吧~~~~
把设置成和IE里的一样看看
把设置成和IE里的一样看看
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询