如何用prototype.js   做一个弹出层后面变灰,不可能操作的那种

解决方案 »

  1.   

    lightbox http://www.huddletogether.com/projects/lightbox2/
    xilinus  http://blogus.xilinus.com/pages/javawin
      

  2.   

    用Proto 干什么 直接用 js 控制div显示 和隐藏吧帮你找找代码,
      

  3.   


    弹出层 和 prototype 有什么关系,能用 纯 JS 写不是更好。http://hi.baidu.com/tshxsky/blog/item/4dc7a0da3f329ddeb7fd4867.html
      

  4.   

    直接写就完了,干嘛非得prototype
      

  5.   

    没有必要使用prototype.js//id为要弹出层的id
    function Estop(id)
    {
        if(document.getElementById("Estop")) 
        {
            var objEstop = document.getElementById("Estop");
            objEstop.style.display = "";
            objEstop.style.width = document.body.offsetWidth + 'px';  
            objEstop.style.height = document.body.offsetHeight + 'px';
        }
        else
        {
            var str = document.createElement("div");  
            str.id = "Estop";  
            str.style.position = "absolute";
            str.style.width = document.body.offsetWidth + 'px';  
            str.style.height = document.body.offsetHeight + 'px'; 
            str.style.backgroundColor = "Black";
            str.style.zIndex = 10;
            str.style.top="0";
            str.style.left="0";   
            if(navigator.userAgent.indexOf("MSIE")>0)
            {
                str.style.filter = "alpha(opacity=60)";
            }
            else
            {
                str.style.opacity = 0.6;
            }
            document.body.insertBefore(str,document.getElementById("aspnetForm"));   
        }
        var obj = document.getElementById(id);
        var objTemp = obj;
        obj.parentNode.removeChild(obj);
        var width = objTemp.style.width;
        width = width.substr(0,width.length - 2);
        objTemp.id = id;
        objTemp.style.left=((screen.width-width)/2) + "px";
        objTemp.style.top=(document.documentElement.scrollTop + 150) + "px";
        objTemp.style.display = "block";
        document.body.insertBefore(objTemp,document.getElementById("aspnetForm"));
        HidSelect("none");
        }function removeEstop(id)
    {
        if(document.getElementById("Estop")) document.getElementById("Estop").style.display = "none";
        if(document.getElementById(id)) document.getElementById(id).style.display = "none";
        HidSelect("");
    }
      

  6.   

    嗯 那个prototype只是打包了JS的功能哦,其实还是用JS做的.