遇到一难题,求各位DOM高手搭救,分数不够再加。 呵呵,不想多说啥了.....combo就是input和select的结合 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to net_lover(孟子E章)老大全部贴出来,实在不太可能太多了,而且全贴出来,我就要去坐牢了我试着尽量整理出来。 to net_lover(孟子E章)老大全部贴出来,实在不太可能太多了,而且全贴出来,我就要去坐牢了--0000我试着尽量整理出来---------==================-------------------=======================----------说明你的意图吧.如果说白夜花寒的那个意思的话js就比较容易做到了.直接onclick触发层我的想法 你可以参考http://www.mozilla.org/docs/web-developer/看看非IE的写法 先感谢各位的回复。先说明一下,原程序不是我所写,我接手也不过10几天。我只是负责将其改的能在IE上正确运行。再说一下这个combobox的意图,我个人的理解可能有欠缺,望大家见谅。原程序作了一个table,不同的列具有不同的属性,比如第一列是不可修改的文字,第二列是Text数字,第三列则是combobox。当点击第三列上的cell时,就出现combobox并可以选择或输入。我下午整理了一下,作了一个HTML,我是按照原程序做的希望大家帮我看一看运行时先按下[Call insertComboBox()]按钮,会出现一个所谓的combo(很丑陋),然后将鼠标点入text部分。点击text以外的部分,combo会消失。程序原意是点击那个按钮会有下拉菜单,可现在点击那个按钮combo也会消失,而且IE上还会像死机一样,没有动作。而完整的原程序在Netscape上很正常点击text以外的部分(除按钮),combo会消失。而点击按钮时不会进入blur_ComboBox。------------------------------------------------------------------------<HTML><HEAD><TITLE> combo sample </TITLE><script type="text/javascript">var _dom = (document.all ? (document.getElementById ? 2 : 1) : (document.getElementById ? 4 : (document.layers ? 3 : 0)));function setDivVisibility(div, visible) { if (_dom == 4 || _dom == 2 || _dom == 1) { div.style.visibility = (visible) ? 'inherit' : 'hidden'; return; } if (_dom == 3) { div.visibility = (visible) ? 'inherit' : 'hide'; return; }}function ComboBox(blurFunc) { this.type = "combo"; this.blurFunc = blurFunc; this.visibility = false; this.options = new Array(); this.expops = new Array(); this.value = ""; this.setFocus = setFocus_ComboBox; this.setVisibility = setVisibility_ComboBox; this.getVisibility = getVisibility_ComboBox; this.create();}function setFocus_ComboBox() { this.txtview.focus();}function setVisibility_ComboBox(visible) { this.visibility = visible; setDivVisibility(this.lyr, visible);}function getVisibility_ComboBox() { return this.visibility;}ComboBox.prototype.create = function() { this.lyr = document.createElement("DIV"); this.lyr.style.position='absolute'; this.txtview = document.createElement("INPUT"); this.txtview.name = "SPComboBox"; this.txtview.id = "SPComboBox"; this.txtview.className = "combo-input"; this.txtview.parent = this; this.txtview.onblur = blur_ComboBox; this.lyr.appendChild(this.txtview); this.valcon = document.createElement("INPUT"); this.valcon.type = "hidden"; this.lyr.appendChild(this.valcon); this.button = document.createElement("BUTTON"); this.button.appendChild(document.createTextNode('I')); this.button.className = "combo-button"; this.button.style.position = "absolute"; this.button.parent = this; this.lyr.appendChild(this.button); this.button.onfocus = function () { //alert("[button.onfocus] start ... "); this.blur(); }; this.button.onmousedown = this.toggle; this.txtview = this.lyr.childNodes[0]; this.valcon = this.lyr.childNodes[1]; document.body.appendChild(this.lyr);}ComboBox.prototype.toggle = function() { //alert("[toggle] start ... ");}function blur_ComboBox() { //alert("[blur_ComboBox] start ... "); var theCombo = this.parent; if (theCombo != null) { if (theCombo.blurFunc) { theCombo.blurFunc(); } theCombo.setVisibility(false); }}function insertComboBox() { var combox = new ComboBox(onBlurFunc);}function onBlurFunc() { //alert("[onBlurFunc] start...");}</script></HEAD><BODY"><button onclick="insertComboBox();">Call insertComboBox()</button></BODY></HTML>------------------------------------------------------------------------- js函数自加载问题 一个评分控件的错误,请帮忙改正一下 下面这个代码怎么用啊 加在哪里 谁能帮忙写段匹配table的正则表达式(哎,正则表达式老是学不会,悲哀!) 请问这里的/怎么理解 谁有用javascript写的line()函数(也就是画线的程序) 关于 for 循环的问题,高人请进!!!谢谢!急! 请教在文本框中回车自动提交表单的办法 请问如何捕捉页面中光标位置的偏移量,想实现一个书签功能 this关键字居然没有指回调用它那个对象? listbox传值的问题 一个问题,大家帮忙看看
全部贴出来,实在不太可能太多了,而且全贴出来,我就要去坐牢了
我试着尽量整理出来。
全部贴出来,实在不太可能太多了,而且全贴出来,我就要去坐牢了--0000
我试着尽量整理出来
---------==================-------------------=======================----------
说明你的意图吧.
如果说白夜花寒的那个意思的话
js就比较容易做到了.
直接onclick触发层
我的想法
http://www.mozilla.org/docs/web-developer/
看看非IE的写法
先说明一下,原程序不是我所写,我接手也不过10几天。我只是负责将其改的能在IE上正确运行。
再说一下这个combobox的意图,我个人的理解可能有欠缺,望大家见谅。原程序作了一个table,不同的列具有不同的属性,比如第一列是不可修改的文字,第二列是Text数字,第三列则是combobox。
当点击第三列上的cell时,就出现combobox并可以选择或输入。我下午整理了一下,作了一个HTML,我是按照原程序做的希望大家帮我看一看
运行时先按下[Call insertComboBox()]按钮,会出现一个所谓的combo(很丑陋),然后将鼠标点入text部分。点击text以外的部分,combo会消失。程序原意是点击那个按钮会有下拉菜单,可现在点击那个按钮combo也会消失,而且IE上还会像死机一样,没有动作。而完整的原程序在Netscape上很正常
点击text以外的部分(除按钮),combo会消失。而点击按钮时不会进入blur_ComboBox。
------------------------------------------------------------------------
<HTML>
<HEAD>
<TITLE> combo sample </TITLE>
<script type="text/javascript">
var _dom = (document.all ? (document.getElementById ? 2 : 1) :
(document.getElementById ? 4 : (document.layers ? 3 : 0)));function setDivVisibility(div, visible) {
if (_dom == 4 || _dom == 2 || _dom == 1) {
div.style.visibility = (visible) ? 'inherit' : 'hidden';
return;
}
if (_dom == 3) {
div.visibility = (visible) ? 'inherit' : 'hide';
return;
}
}
function ComboBox(blurFunc) {
this.type = "combo";
this.blurFunc = blurFunc;
this.visibility = false; this.options = new Array();
this.expops = new Array();
this.value = "";
this.setFocus = setFocus_ComboBox;
this.setVisibility = setVisibility_ComboBox;
this.getVisibility = getVisibility_ComboBox;
this.create();
}function setFocus_ComboBox() {
this.txtview.focus();
}function setVisibility_ComboBox(visible) {
this.visibility = visible;
setDivVisibility(this.lyr, visible);
}function getVisibility_ComboBox() {
return this.visibility;
}ComboBox.prototype.create = function() {
this.lyr = document.createElement("DIV");
this.lyr.style.position='absolute'; this.txtview = document.createElement("INPUT");
this.txtview.name = "SPComboBox";
this.txtview.id = "SPComboBox";
this.txtview.className = "combo-input";
this.txtview.parent = this;
this.txtview.onblur = blur_ComboBox;
this.lyr.appendChild(this.txtview);
this.valcon = document.createElement("INPUT");
this.valcon.type = "hidden";
this.lyr.appendChild(this.valcon); this.button = document.createElement("BUTTON");
this.button.appendChild(document.createTextNode('I'));
this.button.className = "combo-button";
this.button.style.position = "absolute";
this.button.parent = this; this.lyr.appendChild(this.button);
this.button.onfocus = function () {
//alert("[button.onfocus] start ... ");
this.blur();
};
this.button.onmousedown = this.toggle; this.txtview = this.lyr.childNodes[0];
this.valcon = this.lyr.childNodes[1]; document.body.appendChild(this.lyr);
}ComboBox.prototype.toggle = function() {
//alert("[toggle] start ... ");
}function blur_ComboBox() {
//alert("[blur_ComboBox] start ... ");
var theCombo = this.parent;
if (theCombo != null) {
if (theCombo.blurFunc) {
theCombo.blurFunc();
} theCombo.setVisibility(false);
}
}
function insertComboBox() {
var combox = new ComboBox(onBlurFunc);
}function onBlurFunc() {
//alert("[onBlurFunc] start...");
}</script></HEAD><BODY">
<button onclick="insertComboBox();">Call insertComboBox()</button>
</BODY>
</HTML>
-------------------------------------------------------------------------