簡體   English   中英

在JavaScript中顯示消息框

[英]Display Message box in javascript

我正在使用以下代碼在JavaScript中創建一個消息框

<div id="uLightBox" style="top: 4906px; left: 236px;">
    <div id="lbHeader" class="top"><header>Alert</header></div>
    <div id="lbContent">User cannot be deleted.</div>
    <div id="lbFooter" class="bottom">
        <input type="button" class="flat floatRight" value="OK" id="OK">
    </div>
</div>

但是此消息框顯示在頁面中間。 而我的頁面顯示了一百多條記錄。 如果我的消息框顯示在頁面的中間,則每次都必須向下滾動。 請建議...

謝謝,

凱思

使用類似這樣的樣式:style =“ position:fixed; left:50%; top:50%; margin-left:-200px; margin-top:-100px;”。

其中200和100實際上是width / 2和height / 2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM