图片不知道能不能看到 我在做一个QQ注册页面 打开腾讯的QQ注册页面 点击年这个文本款 会出现一个层有很多年份给你选择,但是我点击出来的这个层会被下面的文本框挡住,如何向腾讯一样不被挡住,我试了z-index不行,而且腾讯貌似也没用这个!求解!最好能加我QQ帮解答下80286048

解决方案 »

  1.   

    图片看不到哦看看这里 http://w3help.org/zh-cn/kb/013/ 希望能帮助到你啊,喵~
      

  2.   

    显现弹出一层窗体:如下// JScript 文件
    function ShowDialog(nWidth, nHeight, strUrl, strTitleName)
    {
        var mydiv=document.getElementById("fcolor");
        var nHeight=nHeight;
        var scolor=getCurrentStyle(mydiv, "backgroundColor", "background-color");
        /*ie6*/
    if(scolor=="#0000ff")
    {
            nHeight=nHeight-10;
    }/*ie7*/
    else if(scolor=="#ff0000")
    {
        nHeight=nHeight+10;
        document.getElementById("iframeDialog").style.height = nHeight-21+"px";
    }/*firefox*/
    else if(scolor=="rgb(0, 255, 0)")
    {
        nHeight=nHeight+10;
        document.getElementById("iframeDialog").style.height = nHeight-21+"px";
    }
    else
    {
        nHeight=nHeight+10;
        document.getElementById("iframeDialog").style.height = nHeight-21+"px";
    }

    document.getElementById("divDialog").style.display = "block";
    document.getElementById("divDialog").style.visibility = "visible";
    document.getElementById("divDialog").style.top = (window.screen.height/2-nHeight/2)/2-23+"px";
    document.getElementById("divDialog").style.left = (window.screen.width/2-nWidth/2)+"px";
    document.getElementById("divDialog").style.width = nWidth+"px";
    document.getElementById("divDialog").style.height = nHeight+"px";
    var fid=document.getElementById("hfActiveWin").value;
    var num=Math.round(Math.random()*10000);
    if(strUrl.indexOf('?')!=-1){strUrl+="&a="+num+"&fid="+fid}else{strUrl+="?a="+num+"&fid="+fid;}
    document.getElementById("iframeDialog").src = strUrl;
    document.getElementById("divTitleName").innerHTML = strTitleName;
    document.getElementById("divTitleName").style.width = nWidth-50+"px";

    document.getElementById("divBackground").style.width = "100%";
    document.getElementById("divBackground").style.height = "100%";
    document.getElementById("divBackground").style.display = "block";
    document.getElementById("divBackground").style.visibility = "visible";
    document.getElementById("divBackground").style.top = "0px";
    document.getElementById("divBackground").style.left = "0px";

    Sethidden1();
    }其次,窗体上弹出窗体:如下
    [code=JScript]
    function ShowDialog1(nWidth, nHeight, strUrl, strTitleName)
    {
        var mydiv=document.getElementById("fcolor");
        var nHeight=nHeight;
        var scolor=getCurrentStyle(mydiv, "backgroundColor", "background-color");
        /*ie6*/
    if(scolor=="#0000ff")
    {
            nHeight=nHeight-10;
    }/*ie7*/
    else if(scolor=="#ff0000")
    {
        nHeight=nHeight+10;
        document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
    }/*firefox*/
    else if(scolor=="rgb(0, 255, 0)")
    {
        nHeight=nHeight+10;
        document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
    }else
    {
    nHeight=nHeight+10;
        document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
    }
    document.getElementById("divDialog1").style.display = "block";
    document.getElementById("divDialog1").style.visibility = "visible";
    document.getElementById("divDialog1").style.top = (window.screen.height/2-nHeight/2)/2-23+"px";
    document.getElementById("divDialog1").style.left = (window.screen.width/2-nWidth/2)+"px";
    document.getElementById("divDialog1").style.width = nWidth+"px";
    document.getElementById("divDialog1").style.height = nHeight+"px";
    var num=Math.round(Math.random()*10000);
    if(strUrl.indexOf('?')!=-1){strUrl+="&a="+num}else{strUrl+="?a="+num;}
    document.getElementById("iframeDialog1").src="about:blank";
    document.getElementById("iframeDialog1").src = strUrl;
    document.getElementById("divTitleName1").innerHTML = strTitleName;
    document.getElementById("divTitleName1").style.width = nWidth-50+"px";

    document.getElementById("divBackground1").style.width = "100%";
    document.getElementById("divBackground1").style.height = "100%";
    document.getElementById("divBackground1").style.display = "block";
    document.getElementById("divBackground1").style.visibility = "visible";
    document.getElementById("divBackground1").style.top = "0px";
    document.getElementById("divBackground1").style.left = "0px";
    }[/code]