c " /> 亚洲一区二区三区四区电影,亚洲视频自拍,亚洲欧美资源在线

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

一個用js實現控制臺控件的代碼

復制代碼 代碼如下:
<body margin="0">
</body>
<script>
    function Console(width,height,command)
    {
        var container=document.createElement("div");
        this.container=container;

        container.runtimeStyle.width=(width);
        container.runtimeStyle.height=(height);
        container.runtimeStyle.margin="0px";
        container.runtimeStyle.backgroundColor="black";
        container.runtimeStyle.fontFamily="Terminal";
        container.runtimeStyle.color="white";
        container.runtimeStyle.fontSize="16px";
        this.output=document.createElement("div");
        container.appendChild(this.output);
        container.innerHTML+="js>"
        this.input=document.createElement("input");
        container.appendChild(this.input);
        this.input.runtimeStyle.backgroundColor="black";
        this.input.runtimeStyle.borderWidth="0px";
        this.input.runtimeStyle.color="white";
        this.input.runtimeStyle.fontFamily="Terminal";
        this.input.runtimeStyle.width="90%"
        this.input.runtimeStyle.fontSize="16px"
        this.input.runtimeStyle.position="relative";
        this.input.runtimeStyle.top="2px";
        command=command||function(str)
        {

            var e;
            try{
                var r=eval(str);
            } catch(e) {
                return "Bad command";
            }
            return r;

        }

        this.input.command=function()
        {
            this.parentNode.childNodes[0].innerHTML+=this.value+'<br/>'
            this.parentNode.childNodes[0].innerHTML+=(command(this.value)+"<br/>")

        }
        this.input.onkeyup=new Function("e","e=e||event;if(e.keyCode!=13)return;this.command();this.value='';");
        this.appendto=function(parent)
        {
            parent.appendChild(this.container);
        }
        container=null;
    }

    //var db=new DrawingBoard(100,100)
    //db.drawLine([5,5],[36,44],"red")
    //document.body.appendChild(db.container);
    var c=new Console("100%","100%");
    c.appendto(document.body);

</script>

JavaScript技術一個用js實現控制臺控件的代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 新郑市| 长海县| 囊谦县| 石台县| 康保县| 正定县| 开原市| 北京市| 宝应县| 临安市| 甘南县| 若尔盖县| 清镇市| 岳阳县| 巴里| 广安市| 时尚| 贵定县| 永靖县| 扎鲁特旗| 谢通门县| 福鼎市| 阳新县| 元阳县| 汽车| 定结县| 昂仁县| 黄梅县| 随州市| 临猗县| 宣威市| 买车| 抚州市| 永靖县| 洪泽县| 崇左市| 东方市| 胶南市| 醴陵市| 章丘市| 新营市|