ECSHOP里有这个效果,是创建了个textvar txt = document.createElement("INPUT");
  txt.value = (val == 'N/A') ? '' : val;
  txt.style.width = (obj.offsetWidth + 12) + "px" ;  /* 隐藏对象中的内容,并将输入框加入到对象中 */
  obj.innerHTML = "";
  obj.appendChild(txt);
  txt.focus();

解决方案 »

  1.   

    重复发帖,呵呵.
    创建两个div.其中一个div是另一个的儿子
      

  2.   


    function showSubCategory(){
    $("#AllSort dt").mouseover(function(){
    var newDiv=document.getElementById("EFF_div_"+this.id.substr(7));
    this.className="curr";
    if (newDiv){
    newDiv.style.display="block";
    return;
    }else{
    var CLASS_NAME=($.browser.msie?($.browser.version>"7.0")?"class":"className":"class");
    var newDiv_wrap=document.createElement("div");
    newDiv_wrap.setAttribute(CLASS_NAME,"pop_wrap");
    newDiv_wrap.setAttribute("id","EFF_div_"+this.id.substr(7))
    var newDiv=document.createElement("div");
    newDiv.setAttribute(CLASS_NAME,"pop");
    newDiv_wrap.appendChild(newDiv);
    newDiv.innerHTML=this.nextSibling.innerHTML;
    this.parentNode.insertBefore(newDiv_wrap,this);
    newDiv_wrap.style.display="block";
    }
    //test/
    $(".pop_wrap").mouseover(function(){
    $(this).css({"display":"block"});
    this.nextSibling.className="curr";
    }).bind("mouseleave",function(){
    $(this).css({"display":"none"});
    this.nextSibling.className="";
    })
    //test end/
    }).bind("mouseleave",function(){
    this.className=(this.nextSibling.className=="Dis")?"curr":"";
    $(".pop_wrap").css({"display":"none"});
    });
    }
      

  3.   

    用的技术是DIV+CSS的隐藏层技术,用Javascript进行控制(鼠标移动的动作),网上有很多这种技术的例子,楼主搜索一下