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

Todd Parker & Scott Jehl : jQuery Mobile Keynote 2011

scottjehl
October 01, 2011

Todd Parker & Scott Jehl : jQuery Mobile Keynote 2011

The jQuery Mobile Keynote delivered at jQuery Conference Fall 2011 in Boston, MA.

scottjehl

October 01, 2011
Tweet

More Decks by scottjehl

Other Decks in Design

Transcript

  1. Todd Parker & Scott Jehl
    filament group
    State of the
    Framework

    View full-size slide

  2. filament group
    We design engaging sites and
    applications that are simple to
    use and accessible to everyone.

    View full-size slide

  3. A quick restatement of goals & philosophy
    How’d we get here?

    View full-size slide

  4. The mobile web is
    massive

    View full-size slide

  5. http://itu.int/ITU-D/ict/material/FactsFigures2010.pdf
    People
    Billion
    6.8
    Subscriptions
    5.3

    View full-size slide

  6. 35 Billion
    Devices on
    the internet
    Eric Schmidt
    DLD Conference 2011 Keynote
    via http://tcrn.ch/hD4Owx

    View full-size slide

  7. They aren’t all
    iPhones...

    View full-size slide

  8. July 2011
    World Mobile Browsers
    4.01
    12.3
    17.1
    18.17
    19.95
    22.07
    Opera
    iPhone / iPod Touch
    Android
    Nokia
    BlackBerry
    Netfront
    http://gs.statcounter.com/#mobile_browser-ww-monthly-201103-201103-bar

    View full-size slide

  9. Tim Berners-Lee
    July 1996
    “Anyone who slaps a ‘this
    page is best viewed with
    Browser X’ label on a web
    page appears to be yearning
    for the bad old days [...]”

    View full-size slide

  10. ...and work especially well in capable browsers!
    Make it work
    everywhere.

    View full-size slide

  11. All Platforms
    1 codebase

    View full-size slide

  12. iOS Android WebOS
    Blackberry WP7
    Meego/Maemo Kindle 2
    Nook
    Playbook
    Symbian
    Symbian

    View full-size slide

  13. Desktop too.

    View full-size slide

  14. Built on standards

    View full-size slide

  15. and jQuery core
    Mobile + Tablet UI
    Tools + utilities

    View full-size slide

  16. Familiar API, CDN delivery
    jquery.min.js
    jquery.mobile.min.js
    31kb
    10 - 25kb

    View full-size slide

  17. Progressive Enhancement

    View full-size slide

  18. Don’t break the web.
    Bookmark / Refresh
    Friendly URLS
    History Works
    Now with PushState!
    jquerymobile.com/test/docs/api/globalconfig.html

    View full-size slide

  19. Not the OS
    Design for the brand

    View full-size slide

  20. Keep it accessible

    View full-size slide

  21. Touch, mouse, keyboard
    Touch & Mouse
    Events
    Mouse Events

    View full-size slide

  22. Load only what you need!
    Modular, Decoupled

    View full-size slide

  23. mobile to tablet to desktop
    One framework that
    adapts to context

    View full-size slide

  24. without being exclusive.
    Build rich experiences

    View full-size slide

  25. How to build a
    jQuery Mobile App

    View full-size slide

  26. Step 1.
    Make a regular website

    View full-size slide




  27. My Web App
    body {text-align: center; }


    Welcome to my site!
    Contact


    View full-size slide

  28. Step 2.
    Add jQuery Mobile

    View full-size slide




  29. My Web App
    body { text-align: center; }






    Welcome to my Site!
    Contact


    View full-size slide

  30. Set the zoom
    content="width=device-
    width,initial-scale=1">

    View full-size slide

  31. ...or something.
    Step 3
    Go shopping

    View full-size slide

  32. How the heck?

    View full-size slide

  33. Introducing...
    The Navigation model

    View full-size slide

  34. Listen, intercept, handle w/ Ajax
    products.html

    TAP

    View full-size slide

  35. After that, update the URL
    History, deep linking, bookmarking
    http://example.com/products.html

    View full-size slide

  36. ...or in older browsers
    Hash works as a fallback
    http://example.com/#/products.html

    View full-size slide

  37. Linking Pages

    View full-size slide

  38. How to link pages

    This is a jQuery Mobile link!

    View full-size slide

  39. Look familiar?

    This is a jQuery Mobile link!

    View full-size slide

  40. Configuring Transitions

    This is a jQuery Mobile link!

    View full-size slide

  41. Regular forms; Hijax’d

    Don’t thank us; thank this guy >

    View full-size slide

  42. Transitions too!
    data-transition=”slideup”>

    View full-size slide

  43. “Pages” in the page

    View full-size slide

  44. Page container





    View full-size slide

  45. Page containers are....
    • used to group “pages” in DOM
    • auto-generated for you
    • any kind of element you’d like

    View full-size slide

  46. are pages
    data-rel=”dialog”>
    Open page as a dialog!

    View full-size slide

  47. ...but not in history
    ...but they can be closed with back button

    View full-size slide

  48. Multipage documents

    View full-size slide








  49. ID’d sections

    View full-size slide

  50. Hello world

    Products
    Services
    About us
    Contact

    ...and local anchor links

    View full-size slide

  51. Page Sections

    View full-size slide

  52. Page child roles
    header
    footer
    content

    View full-size slide



  53. ...
    ...
    ...


    Page child roles

    View full-size slide

  54. pros / cons
    •May lend a “native”
    app feel.
    •Useful in certain simple
    UI situations: full-page
    photo galleries, etc.
    •Often translate poorly
    to desktop.
    •Only feel “native” to iOS
    users
    •Uncanny Valley

    View full-size slide


  55. Products
    Services
    About us
    Contact

    A Regular UL

    View full-size slide

  56. Basic unordered list

    View full-size slide


  57. Products
    Services
    About us
    Contact

    Basic unordered list

    View full-size slide

  58. Basic unordered list

    View full-size slide


  59. Hello world

    Products
    Services
    About us
    Contact


    List with links

    View full-size slide

  60. List with links

    View full-size slide

  61. Headers, footers

    View full-size slide

  62. “Fixed” toolbars

    View full-size slide

  63. Form elements

    View full-size slide

  64. Collapsibles

    View full-size slide

  65. Navigation Scripting

    View full-size slide

  66. $.mobile.changePage

    View full-size slide

  67. Change pages via JS
    $.mobile.changePage(“about/us.html”);

    View full-size slide

  68. ...and back
    window.history.back();

    View full-size slide

  69. Submit form data
    $.mobile.changePage(“handler.php”, {
    type: "post",
    data: { "shipping": "Fast!" }
    });

    View full-size slide

  70. $.mobile.loadPage

    View full-size slide

  71. $.mobile.loadPage( "about/us.html" );
    Load pages via JS

    View full-size slide

  72. Page
    loadPage() from HTML

    View full-size slide

  73. Custom Events

    View full-size slide

  74. the new domready
    Introducing
    pagecreate

    View full-size slide

  75. Small code tidbit.
    $( “.ui-page” ).live( “pagecreate”,
    function(){
    alert( “I’m created!” );
    });

    View full-size slide

  76. pre-parse the markup here
    Also:
    pagebeforecreate

    View full-size slide

  77. pagebeforecreate
    $( “div” ).live( “pagebeforecreate”,
    function(){
    alert( “I’m about to be created!” );
    });

    View full-size slide

  78. Page Change Events

    View full-size slide

  79. All Page Change Events
    • pagebeforechange
    • pagebeforeshow
    • pagebeforehide
    • pageshow
    • pagehide
    • pageremove
    • pagechange

    View full-size slide

  80. Putting it all together

    View full-size slide

  81. http://filamentgroup.com/lab/jquery_mobile_pagination_plugin/
    About those
    pagination links...

    View full-size slide

  82. vmousedown | vmouseover | vmouseup | vmousemove | vmouseclick
    Virtualized Events

    View full-size slide

  83. Use ‘em like mouse events
    $( “a.toggleable” ).bind( “vclick”,
    function(){
    $(this)
    .next()
    .toggleClass( “hidden” );
    });

    View full-size slide

  84. $.noConflict() for your HTML
    Data Attr Namespacing

    View full-size slide

  85. $.mobile.allowCrossDomainPages

    View full-size slide

  86. Also.
    • Configurable text strings (i18n)
    • Updating page titles
    • No more meta viewport injection

    View full-size slide

  87. Also.
    • URL bar hidden: iOS + Android
    • Smoother transitions
    • Improved URL Handling
    • Pinch zooming enabled
    • Auto Back buttons OFF

    View full-size slide

  88. Widget Decoupling
    • header/content/footer
    • collapsible
    • controlgroup
    • fieldcontain
    • fixheaderfooter
    • button
    • checkboxradio
    • select
    • slider
    • textinput
    • links theming
    • listview
    • navbar
    • grid

    View full-size slide

  89. Cleaner design

    View full-size slide

  90. Page wrapper: optional

    View full-size slide

  91. Gradients: More!

    View full-size slide

  92. New create event
    $( ...new markup that contains widgets... )
    .appendTo( ".ui-page" )
    .trigger( "create" );

    View full-size slide

  93. Also.
    • DOM management
    • Data-prefetch
    • autoInitializePage
    • Configuration improvements

    View full-size slide

  94. history.pushState

    View full-size slide

  95. pagebeforechange

    View full-size slide

  96. iOS5 Overflow & Fixies

    View full-size slide

  97. data-content-theme

    View full-size slide

  98. What’s Next?

    View full-size slide

  99. 1.0 in weeks

    View full-size slide

  100. Theming is hard.

    View full-size slide

  101. Basic TR demo movie

    View full-size slide

  102. Download Builder in the works!
    Also!

    View full-size slide

  103. Build, Contribute

    View full-size slide

  104. Demos & Docs
    jquerymobile.com/demos/1.0rc1/
    Live dev snapshot
    jquerymobile.com/test/
    Nightlies, Latest
    jquerymobile.com/latest/

    View full-size slide

  105. fork & contribute
    github.com/jquery/jquery-mobile

    View full-size slide

  106. Build your own
    $ git clone git://github.com/jquery/
    jquery-mobile.git
    $ cd jquery-mobile
    $ make
    1
    2
    3

    View full-size slide

  107. Thanks core team!
    • Kin Blas ( Adobe )
    • John Bender ( Adobe )
    • Ghislain Seguin ( Jive )

    View full-size slide

  108. Awesome sponsors are awesome
    filament group

    View full-size slide

  109. Thanks! Questions?
    @toddmparker
    @scottjehl

    View full-size slide