<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>
爲什麼它告訴我CustomAlert
是未定義的?我也試圖將CustomAlert()
分配給一個var,但是然後控制檯告訴我var現在是未定義的。爲什麼我的函數調用不工作?
謝謝新手的錯誤... – 2015-02-08 18:28:36
@KevinAddison歡迎你花花公子。我很高興我幫助! – Christos 2015-02-08 18:29:30