そのようなメッセージポップアップには、hide / dismiss/cancelコマンドはないと思います。キーボードのEscキーを押すと、キャンセルコマンドが呼び出されます。これらの種類のメッセージは、情報提供を目的としたものではありません。代わりに「FlyOut」を使用する必要があります。
HTML:
<!-- Define a flyout in HTML as you wish -->
<div id="informationFlyout" data-win-control="WinJS.UI.Flyout">
<p>
Some informative text
</p>
</div>
<!-- an anchor for the flyout, where it should be displayed -->
<div id="flyoutAnchor"></div>
JS:
// Get an anchor for the flyout
var flyoutAnchor = document.getElementById("flyoutAnchor");
// Show flyout at anchor
document.getElementById("informationFlyout").winControl.show(flyoutAnchor);
設定された時間が経過した後にフライアウトを閉じるには、setTimeoutを実行して、コード内に非表示にすることができます。
// execute this code after 2000ms
setTimeout(function () {
// Fetch the flyout
var flyout = document.getElementById("informationFlyout"); // Get the flyout from HTML
// Check if the element still exists in DOM
if (flyout)
flyout.winControl.hide(); // Dismiss the flyout
}, 2000);
FlyOut-ポップアップについて詳しくはこちらをご覧ください