2012-10-11 152 views

回答

1

要處理按鈕單擊事件,並顯示在點擊,你可以做一個div

$("#button").click(function() { 
    $("#yourDialog").show(); 
}); 

http://jsfiddle.net/yGtwT/

你也可以使用一個jQuery Dialog顯示一個「彈出」。

$(document).ready(function() { 
    $("#yourDialog").dialog(); 
}); 

$("#button").click(function() { 
    $("#yourDialog").dialog('open'); 
});​ 

http://jqueryui.com/dialog/

0

使用的東西,jQuery庫包含模態對話框。

0

下面是如何顯示一個彈出框,選擇不同的標記值,先在html:

<div style="display: none"> 
    <div id="tagDialogBox" title="Add Tags"> 
    @* other html here *@ 
    </div> 
</div> 

這裏的jQuery的,請注意,您需要添加.parent()appendTo($(」爲了窗體名稱「))允許對話框字段所要提交的表單的一部分:

function showTagDialogBox() { 
    $('#tagDialogBox').dialog({ 
     autoOpen: true, 
     title: "Select Tags", 
     modal: true, 
     height: 530, 
     width: 800, 
     buttons: { 
      "Ok": function() { 
       $(this).dialog("close"); 
      } 
     } 
    }).parent().appendTo($("form:first")); 

    return false; 
} 
0

這是非常簡單的。

<input type="button" onclick="$('dialogbox').dialog();"/> 

此外,jquery ui頁面上的示例。這是一個非常簡單的(雖然它也包括動畫,你可以拉說出來爲例)

http://jqueryui.com/dialog/#animated

相關問題