2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jQuery Mobileの勉強 − ダイアログ表示

Posted at

Dialog

  • data-role="dialog"を指定する必要があります。
  • aリンクで遷移することで表示できます。
<section id="dialog" data-role="dialog" data-close-btn-text="閉じる">
  <header data-role="header">
    <h3>ヘッダ</h3>
  </header>
  <article data-role="content">
    <p>jQuery Mobileのダイアログ</p>
  </article>
</section>

サンプルコード

<!DOCTYPE html> 
<html lang="ja"> 
    <head> 
        <title>Page Title</title> 
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
    </head> 
    <body> 
        <section id="page" data-role="page">
            <header data-role="header">
                <h3>jQuery Mobile</h3>
            </header>
            <article data-role="content">
                <p><a href="#dialog">ダイアログを開く</a></p>
            </article>
            <footer data-role="footer">
                <h3>Footer</h3>
            </footer>
        </section>
        <!-- リンクによって開かれるダイアログ -->
        <section id="dialog" data-role="dialog" data-close-btn-text="閉じる">
            <!-- ダイアログ -->
            <header data-role="header">
                <h3>ヘッダ</h3>
            </header>
            <article data-role="content">
                <p>jQuery Mobileのダイアログ</p>
            </article>
        </section>
    </body>
</html>
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?