-
Notifications
You must be signed in to change notification settings - Fork 0
Alert
NickWare edited this page Dec 27, 2021
·
1 revision
Default Alert element HTML model:
<div class="Window">
<div class="GlobalArea">
<div class="WorkArea">
...
</div>
</div>
<div id="OV" class="Overlay"></div>
<div id="AE" class="Alert Rounded Scaled">
<div class="AlertCaption"></div>
<div class="AlertText"></div>
<div class="AlertButtons">
<div id="AB-OK" class="Button Rounded">OK</div>
<div id="AB-Y" class="Button Rounded">Yes</div>
<div id="AB-N" class="Button Rounded">No</div>
</div>
</div>
</div>Notice: the default alert and overlay IDs should be “AE” and “OV” respectively.
JS:
AlertShow("Test message", // alert caption
"Yes or no?", // alert text
"warning", // alert type
"YESNO", // alert button type
[function() { // on YES
console.log("yes");
}, function() { // on NO
console.log("no");
}]);
// default alert button type is "OK"
AlertShow("Alert", "Message", "info");
AlertShow("Alert", "Message", "error", "OK", [
function() { // on OK
console.log("ok");
}]);