Upgrade to Pro — share decks privately, control downloads, hide ads and more …

jQuery Mobile - Web Delivery for All

jQuery Mobile - Web Delivery for All

Mobile web development frameworks are targeting the builtin web browsers on iPhone and Android only; however, jQuery mobile has in a different vision, one that will reach the largest distribution of phones possible. Leveraging the ways of progressive enhancement, your website can be viewed in raw HTML on old mobile phones and then enhanced with nice CSS styles across mobile platforms that have a decent CSS and JavaScript support. In this session, Grabanski gives you his list of reasons to use jQuery mobile, an overview of the framework and will draw from his experiences building websites on top of jQuery Mobile.

Marc Grabanski

May 12, 2012
Tweet

More Decks by Marc Grabanski

Other Decks in Technology

Transcript

  1. The web is for everyone and all can view it

    The Great Promise of the Web
  2. Fully Supported • iOs 3.2+, Android 2.1+/Honeycomb • Windows Phone

    7 • Blackberry 6.0/Playbook • Palm WebOS 1.4+ • Mobile Opera & Mobile Firefox • Amazon Kindle 3 & Fire • Desktop Chrome, FF, IE 7+, Opera
  3. Progressive Enhancement C-Grade: Basic HTML B-Grade: Enhanced Style, No Ajax

    A-Grade: Full Enhanced Style, Ajax and CSS Transitions + ++
  4. Get the (Coding)Party Including Latest: ! <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/ jquery.mobile-1.2.0.min.css"

    /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.0/ jquery.mobile-1.2.0.min.js"></script> http://jquerymobile.com/download/
  5. Auto-Ajax Links 1. Ajax gets href=”page.html” 
 (unless data-ajax=false) 2.

    Slides in New Content 3. Updates URL
 (with <body>...</body> 
 or data-role=page)
  6. Page Transitions • <a data-transition=pop>...</a>
 (slide, slideup, slidedown, pop, fade,

    flip) ! • <a data-transition=pop 
 data-direction=reverse>...</a> http://jquerymobile.com/demos/1.2.0/docs/pages/page- transitions.html
  7. Pages w/out Ajax <div data-roll=page 
 id=page1>...</div> <div data-roll=page
 id=page2>...</div>

    ! <a href=”#page1”>Page 1</a> <a href=”#page2”>Page 2</a> http://jquerymobile.com/demos/1.2.0/docs/pages/multipage- template.html
  8. 1. Form action=”page.html” POST Ajax 2. Slides in New Content

    3. Updates URL
 (same as links)
 Auto-Ajax Forms
  9. Listview <ul data-role=listview ...> <li data-role=list-divider>...</li> <li><a href=”...”></a></li> <li><a href=”...”></a></li>

    <li><a href=”...”></a></li> <li><a href=”...”></a></li> <li><a href=”...”></a></li> ... </ul>
  10. data-* Theme Attributes • data-theme=[a-f] • data-[element]theme=[a-f] • <ul data-dividertheme=[a-f]>

    • <ul data-inset=true> http://jquerymobile.com/demos/1.2.0/docs/api/themes.html
  11. data-* Button Theming <button data-icon=*>
 arrow-r, delete, plus, minus, gear,

    grid, refresh, etc. http://jquerymobile.com/demos/1.2.0/docs/buttons/ buttons-icons.html
  12. Control Group <div data-role=controlgroup
 data-type=horizontal> <a data-role=button>Yes</a> <a data-role=button>No</a> <a

    data-role=button>Maybe</a> </div> http://jquerymobile.com/demos/1.2.0/docs/buttons/ buttons-grouped.html
  13. Widgets • page sections • checkboxradio • select • slider

    • textinput • links • collapsible • popup • controlgroup • fieldcontain • fixheaderfooter • button • listview • navbar • grid • dialog
  14. Snippets Configure jQM $(document).on("mobileinit", function(){ $.extend($.mobile , { foo: bar

    }); }); New DOM Ready $(document).on(“pagecreate”, function(e) { // do somefin’ will ya? });
  15. CSS Transitions • New transitions turn and flow 
 as

    of 1.1 • Flip on Android is Stupid
 (does a cartwheel)
  16. jQuery Mobile Router https://github.com/azicchetti/jquerymobile-router var approuter = new $.mobile.Router([ {

    "#certainPage": { handler: "foo", events: "s" } }, { "#certainPage": { handler: "bar", events: "h" } } ], { foo: function(...){...}, bar: function(...){...} }, options);