2012-06-19 28 views

回答

3

你能提供你的代碼嗎? 這個工作對我來說:

Windows.UI.Popups.MessageDialog("Content", "Title").showAsync(); 
+0

現在是working.Thanku @ Pauliusnrk。 –

0

除非是seriouse錯誤,我會建議使用彈出:

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); 

瞭解更多關於彈出,彈出窗口here

相關問題