要求用户在浏览页面时对其进行操作提示登录,登陆框在浏览页显示然后浏览页变灰,用户登陆后恢复到浏览页用户操作的步骤。 
怎么做??
能不用控件吗·?

解决方案 »

  1.   

    // JScript 文件var isIe=(document.all)?true:false;
    //div位置控制
    function mousePosition()
    {
    return {x:document.body.scrollWidth/2+150,y:250};
    }
    //弹出方法
    function showMessageBox(wTitle,content,pos,wWidth)
    {
    closeWindow();
    var bWidth=parseInt(document.documentElement.scrollWidth);
    var bHeight=parseInt(document.documentElement.scrollHeight);
    var back=document.createElement("div");
    back.id="back";
    var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
    styleStr+=(isIe)?"filter:alpha(opacity=40);":"opacity:0.40;";
    back.style.cssText=styleStr;
    document.body.appendChild(back);
    var mesW=document.createElement("div");
    mesW.id="mesWindow";
    mesW.className="mesWindow";
    mesW.innerHTML="<div class='mesWindowTop'><table width='100%' height='100%'><tr><td>"+wTitle+"</td><td style='width:1px;'><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td></tr></table></div><div class='mesWindowContent' id='mesWindowContent'>"+content+"</div><div class='mesWindowBottom'></div>";
    styleStr="left:"+(((pos.x-wWidth)>0)?(pos.x-wWidth):pos.x)+"px;top:"+(pos.y)+"px;position:absolute;width:"+wWidth+"px;";
    mesW.style.cssText=styleStr;
    document.body.appendChild(mesW);
    }
    function showBackground(obj,endInt)
    {
    obj.filters.alpha.opacity+=1;
    if(obj.filters.alpha.opacity<endInt)
    {
    setTimeout(function(){showBackground(obj,endInt)},8);
    }
    }
    //关闭窗口
    function closeWindow()
    {
    if(document.getElementById('back')!=null)
    {
    document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
    }
    if(document.getElementById('mesWindow')!=null)
    {
    document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
    }
    }
    //测试弹出
    function testMessageBox()
    {
    var objPos = mousePosition();
    messContent="<div style='padding:20px 0 10px 0;text-align:center;'><iframe frameborder='0' width='300px' src='LinkAdd.aspx' marginheight='0' marginwidth='0'scrolling='no'></iframe></div>";
    showMessageBox('申请链接',messContent,objPos,350);
    }<Input type='button' onclick='testMessageBox()' />
      

  2.   

    discuz 7.0就使用了此方式 建议楼主下载其代码看下 具体也是js实现的
      

  3.   

    很简单的问题,用div做一个层,就OK了