小编Kev*_*son的帖子

为什么我的函数调用不起作用?

<script type="text/javascript">
    function CustomAlert() {
        this.render = function() {
            var winW = window.innerWidth;
            var winH = window.innerHeight;
            var dialogOverlay = document.getElementById('dialogOverlay');
            var dialogbox = document.getElementById('dialogbox');

            dialogOverlay.style.display = "block !important ";
            dialogOverlay.style.height = winH+"px !important ";
            dialogbox.style.left = (winW/2) - (550 * .5) + "px !important ";
            dialogbox.style.top = "100px !important ";
            dialogbox.style.display = "block !important";
        }

        this.ok = function () {
        }
    }

    function HighScore( arg )
    {
        CustomAlert().render();
    }
</script>
Run Code Online (Sandbox Code Playgroud)

为什么告诉我这CustomAlert是不确定的?我也尝试分配CustomAlert()给var但是控制台告诉我var现在是未定义的.

javascript function

3
推荐指数
1
解决办法
92
查看次数

标签 统计

function ×1

javascript ×1