<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现在是未定义的.