{"id":7553,"date":"2012-09-15T13:57:08","date_gmt":"2012-09-15T08:27:08","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=7553"},"modified":"2012-09-15T14:01:31","modified_gmt":"2012-09-15T08:31:31","slug":"getting-started-with-jquery-mobile","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/getting-started-with-jquery-mobile\/","title":{"rendered":"Getting started with jQuery Mobile"},"content":{"rendered":"<p>JQuery mobile provides set of features which are supported on almost all smartphones such as touch UI, ajax navigation, animated page transitions. Building jQuery mobile page is very simple, here&#8217;s how:<\/p>\n<ol>\n<li>A jQuery Mobile site must start with an HTML5 &#8216;doctype&#8217; to take full advantage of all of the framework&#8217;s features.<\/li>\n<li>First of all you need jQuery, jQuery mobile, mobile theme stylesheets from CDN.<\/li>\n<li>Reference all styles &amp; scripts in the head of page.<\/li>\n<p>[html]&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br \/>\n&lt;title&gt;Page Title&lt;\/title&gt;<br \/>\n&lt;link rel=&quot;stylesheet&quot; href=&quot;css\/jquery.mobile-1.1.1.css&quot;\/&gt;<br \/>\n&lt;script src=&quot;js\/jquery-1.8.0.min.js&quot;&gt;&lt;\/script&gt;<br \/>\n&lt;script src=&quot;js\/jquery.mobile-1.1.1.min.js&quot;&gt;&lt;\/script&gt;<br \/>\n&lt;\/head&gt;[\/html]<\/p>\n<li>A meta <strong>viewport<\/strong> tag in the head sets the screen width to the pixel width of the device.<\/li>\n<li>Inside <strong>body<\/strong> of html page a div with <strong>data-role<\/strong> of <strong>page<\/strong> is used as a wrapper for whole page.<\/li>\n<li>For header bar add a <strong>div<\/strong> with <strong>data-role<\/strong> of <strong>header<\/strong>.<\/li>\n<li>For content region add a <strong>div<\/strong> with a <strong>data-role<\/strong> of <strong>content<\/strong> &amp; add content between this <strong>div<\/strong>.<\/li>\n<p>[html]&lt;body&gt;<br \/>\n&lt;div data-role=&quot;page&quot;&gt;<br \/>\n        &lt;div data-role=&quot;header&quot;&gt;<br \/>\n                Header<br \/>\n        &lt;\/div&gt;<br \/>\n        &lt;div data-role=&quot;content&quot;&gt;<br \/>\n                &lt;p&gt;This is jquery mobile test page&lt;\/p&gt;<br \/>\n        &lt;\/div&gt;<br \/>\n        &lt;div data-role=&quot;footer&quot;&gt;<br \/>\n               \u00a9intelligrape<br \/>\n        &lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<br \/>\n[\/html]<\/p>\n<li>There are many features provided by <strong>jQuery mobile<\/strong>. Here i am explaining one of them which is list. For list, simply add <strong>ul<\/strong> tag with attribute <strong>data-role<\/strong> of <strong>listview<\/strong> between <strong><br \/>\n<\/strong><\/p>\n<div><strong><\/strong> .<\/div>\n<\/li>\n<li>To make it look like an inset module add an attribute <strong>data-inset=&#8221;true&#8221;<\/strong>.<\/li>\n<li>For dynamic search filter just add another attribute <strong>data-filter=&#8221;true&#8221;<\/strong>.<\/li>\n<p>[html]<br \/>\n&lt;div data-role=&quot;content&quot;&gt;<br \/>\n    &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-filter=&quot;true&quot;&gt;<br \/>\n          &lt;li&gt;Blue&lt;\/li&gt;<br \/>\n          &lt;li&gt;Black&lt;\/li&gt;<br \/>\n          &lt;li&gt;Green&lt;\/li&gt;<br \/>\n          &lt;li&gt;Yellow&lt;\/li&gt;<br \/>\n          &lt;li&gt;White&lt;\/li&gt;<br \/>\n    &lt;\/ul&gt;<br \/>\n&lt;\/div&gt;<br \/>\n[\/html]\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>JQuery mobile provides set of features which are supported on almost all smartphones such as touch UI, ajax navigation, animated page transitions. Building jQuery mobile page is very simple, here&#8217;s how: A jQuery Mobile site must start with an HTML5 &#8216;doctype&#8217; to take full advantage of all of the framework&#8217;s features. First of all you [&hellip;]<\/p>\n","protected":false},"author":57,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[518],"tags":[245,32,4842,27,970,327],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/7553"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/57"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=7553"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/7553\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=7553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=7553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=7553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}