ダウンロード
jQuery Mobileの本家サイトからダウンロードします。
http://jquerymobile.com/
ライブラリの導入
ダウンロードしたらHTMLにライブラリを使うよう設定します。
下記は本家サイトを参照するようになっていますが、実際は自分のプロジェクトにあるファイルを参照するようにします。
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" /> <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
稼働確認
次のようなHTMLで稼働確認しました。
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, maximum-scale=2.0, minimum-scale=1.0, "> <link rel="stylesheet" type="text/css" href="/lib/jquery_mobile/jquery.mobile.css" charset="utf-8"> <script type="text/javascript" src="/lib/jquery/jquery.js"></script> <script type="text/javascript" src="/lib/jquery_mobile/jquery.mobile.js"></script> </head> <body> <div data-role="page" id="foo"> <div data-role="header"> <h1>Foo</h1> </div> <div data-role="content"> <p>I'm first in the source order so I'm shown as the page.</p> <p>View internal page called <a href="#bar">bar</a></p> </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div> <div data-role="page" id="bar"> <div data-role="header"> <h1>Bar</h1> </div> <div data-role="content"> <p>I'm first in the source order so I'm shown as the page.</p> <p><a href="#foo">Back to foo</a></p> </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div> </body> </html>
イントロ部分だけドキュメントを見たところ、「data-role="~"」でページ構造を表現するみたいです。
画像を見たら何を表すかなんとなくわかると思います。
jQuery Mobileの場合、ExtJSと違って、あくまでもHTMLタグを重んじてる印象。


0 コメント:
コメントを投稿