2

モーダル ウィンドウに関する 1 つの解決策を見つけることができました。リンクはSimple jQuery Modal Window Examplesです。しかし、私が具体的に欲しいのは:

  • 上記のウェブサイトのリンクに示されているように、b.jsp をシンプル ウィンドウ モーダルとして開きたいと考えています。
  • 送信ボタンをクリックした後、b.jsp をそのように開きたいと思います。

いくつかの解決策を試しましたが、同じように機能させることはできません。

以下は私のコードです:

a.jsp

<form action="b.jsp">
<input type="submit" value"click here to open modal window"/>
</form>
4

1 に答える 1

2

JQuery UI の使用は非常に簡単です。

私はいくつかの変更を行います:

load html の送信フォームが不要なため、タイプをボタンに変更します。

<div id="resultreturn" style="display: none"></div>
<form >
<input type="button" value="click here to open modal window" id="loader"/>
</form>

後で、このイベントでイベント クリックをバインドします。

$(document).ready(function(){
    $("#loader").click(function(){
                // Load the page into the div
        $("#resultreturn").load("b.html");
                // Show the modal dialog
        $("#resultreturn").dialog({ modal: true });
    });
});

これがお役に立てば幸いです

于 2012-02-29T13:13:54.567 に答える