近日一直在设计一个网页程序,主要用来学习,在IE下调试成功,但是在火狐下INPUT中无法显示“光标”,是怎么回事啊,各位参考参考?下面贴上主要程序。
一 CSS。
 <style type="text/css">
  body{margin:0px;BACKGROUND: #ffffff;font-family:"宋体", arial;font-size:14px;COLOR: wihte;display:inline;}
  .T_frame{text-align:center;}
  .header_frame{margin:0px auto;border:1px solid #666666;width:1001px;height:120px;}
  .innerframe{position:absolute;zIndex:10009;border:1px solid #666666;background:white;}
  .innerframe LI{float:left;margin:0px;padding:0px;}
  .innerframe UL{float:left;margin:0px;padding:0px;}
  .innerframe INPUT{width:120px;height:16px;}
  .outframe{left:0px;top:0px;background:#cccccc;position:absolute;zIndex:10000;}
 </style>二 主程序
<script type="text/javascript" src="jsfunction.js"></script>
<body>
<div class="T_frame">
    <div class="header_frame">
<ul class="H_navigater">
<li><a href="#" onclick="javascript:showlogindialog(360,206);">用户登陆</></li>
</ul>
    </div>
</body>
三 函数文件(jsfunction.js).
function showlogindialog(Cwidth,Cheight){
var uname=['用户名称:','登陆密码:','验证码:','COOKIE:'];
width=document.documentElement.scrollWidth;
height=document.documentElement.scrollHeight;
DIVleft=(width-Cwidth)/2+"px";
DIVtop=(height-Cheight)/2+"px";
var bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.className="outframe";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=75,finishOpacity=50)";
bgObj.style.width=width+"px";
bgObj.style.opacity="0.6";
bgObj.style.height=height+"px";
document.body.appendChild(bgObj);
var Cobj=document.createElement("div");
Cobj.setAttribute("id","innerbox");
Cobj.className="innerframe";
Cobj.style.left=DIVleft;
Cobj.style.top=DIVtop;
Cobj.style.width=Cwidth+"px";
Cobj.style.height=Cheight+"px";
document.body.appendChild(Cobj);
e=document.createElement('input');document.getElementById("innerbox").appendChild(e);
}
这个程序在IE下可以正常运行,但是在FF下,那个INPUT就没办法实际光标功能,但是键盘可以输入 。大家帮忙参考参考啊,谢谢啦!
这个函数首先生成一个全屏父DIV,半透明,然后生成一个不透明子DIV,位于父DIV之上,但是上面的程序在子DIV中添加进去的INPUT居然不显示光标,在下百思不其解,请各位前辈赐教,或者修改,谢谢了。在IE下可以运行,FF下不行。

解决方案 »

  1.   

    <div>
    <input />
    </div>你自己看显示不显示...拉不出屎,不能赖着茅坑啊.....
      

  2.   

      <style type="text/css">
      body{margin:0px;BACKGROUND: #ffffff;font-family:"宋体", arial;font-size:14px;COLOR: wihte;display:inline;}
      .T_frame{text-align:center;}
      .header_frame{margin:0px auto;border:1px solid #666666;width:1001px;height:120px;}
      .innerframe{position:relative;zIndex:10009;border:1px solid #666666;background:white;}
      .innerframe LI{float:left;margin:0px;padding:0px;}
      .innerframe UL{float:left;margin:0px;padding:0px;}
      .innerframe INPUT{position:absolute; left:20px; top:20px; width:120px;height:16px;}
      .outframe{left:0px;top:0px;background:#cccccc;position:absolute;zIndex:10000;}
      </style> 
    <script>
    function showlogindialog(Cwidth,Cheight){
    var uname=['用户名称:','登陆密码:','验证码:','COOKIE:'];
    width=document.documentElement.scrollWidth;
    height=document.documentElement.scrollHeight;
    DIVleft=(width-Cwidth)/2+"px";
    DIVtop=(height-Cheight)/2+"px";
    var bgObj=document.createElement("div");
    bgObj.setAttribute('id','bgDiv');
    bgObj.className="outframe";
    bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=75,finishOpacity=50)";
    bgObj.style.width=width+"px";
    bgObj.style.opacity="0.6";
    bgObj.style.height=height+"px";
    document.body.appendChild(bgObj);
    var Cobj=document.createElement("div");
    Cobj.setAttribute("id","innerbox");
    Cobj.className="innerframe";
    Cobj.style.left=DIVleft;
    Cobj.style.top=DIVtop;
    Cobj.style.width=Cwidth+"px";
    Cobj.style.height=Cheight+"px";
    document.body.appendChild(Cobj);
    e=document.createElement('input');
    document.getElementById("innerbox").appendChild(e);
    e.select();

    </script>
    <body>
    <div class="T_frame">
    <div class="header_frame">
    <ul class="H_navigater">
    <li> <a href="#" onclick="javascript:showlogindialog(360,206);">用户登陆 </> </li>
    </ul>
    </div>
    </div>
    </body>