SlideShare a Scribd company logo
jQuery Mobile


        2011/12/13 at
                                 #ragtech1213
               Toru Yoshikawa ( @yoshikawa_t )
Toru Yoshikawa
@yoshikawa_t

•   Google API Expert     Chrome

•   html5j.org   HTML5

•   allWeb                   jQuery Mobile

•   Web

•   Blog http://d.hatena.ne.jp/pikotea/
• jQuery Mobile
• jQuery Mobile

•
• Web             API



•
http://jquerymobile.com/
jQuery Mobile
jQuery Mobile
•

• jQuery
•

•
jQuery Mobile

• Cross-platform
• Markup-driven
• Progressive Enhancement
Cross-platform
Apple iOS                 3.2 5.0             A
Android                   2.1 2.3 Honeycomb   A
Windows Phone             7.0 7.5             A
                          6.0 7.0 Playbook    A
Blackberry
                          5.0                 B
Palm WebOS                1.4 2.0 3.0         A
Firefox Mobile            Beta                A
Opera Mobile              11.0                A
Opera Mini                5.0 6.0             B
MeeGo                     1.2                 A
Kindle                    3 Fire              A
Nokia Symbian             Symbian^3           B
Chrome                    11 15               A
Firefox                   4 8                 A
Internet Explorer         7 9                 A
Opera                     10 11               A

               http://jquerymobile.com/gbs/
Markup-driven
         JavaScript



<!--            -->
<a href="#" data-role="button">Button</a>
Progressive Enhancement




  JavaScript ON   JavaScript OFF
jQuery Mobile
•

•


•
jQuery Mobile
•


•
                jQuery
    Mobile
jQuery Mobile

                 CMS




 jQuery Mobile
jQuery Mobile
jQuery Mobile
<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
    <title>       </title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
  </head>
  <body>

    <!--       -->
    <div data-role="page" id="main">
      <!--        -->
      <div data-role="header">
        <h1>       </h1>
      </div>
      <!--            -->
      <div data-role="content">


      </div>
      <!--           -->
      <div data-role="footer">
        <h4>       </h4>
      </div>
    </div>

  </body>
</html>
jQuery Mobile
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, minimum-
scale=1, maximum-scale=1">
  <title>       </title>
  <link rel="stylesheet" href="jquery.mobile-1.0.min.css" />
  <script src="jquery-1.6.4.min.js"></script>
  <script src="jquery.mobile-1.0.min.js"></script>
</head>


          http://jquerymobile.com/download/
‣
    •
    •
    •
<!--       -->
<div data-role="page">
  <!--         -->
  <div data-role="header">
    <h1>       </h1>
  </div>
  <!--           -->
  <div data-role="content">
    
  </div>
  <!--         -->
  <div data-role="footer">
    <h1>       </h1>
  </div>
</div>
•       ajax

‣
    • slide
    • slideup
    • slidedown
    • pop
    • fade
    • flip
<!--           slide                   -->
<a href="#next">slide</a>

<!--                           -->
<a href="#next" data-transition="slideup">slide</
a> 

sample/page_transition.html
•
•
<!--          data-rel        dialog    -->
<a href="#confirm" data-rel="dialog">         </a>

<!--                          --->
<div data-role="page" id="confirm">
  <div data-role="header">
    <h1>       </h1>
  </div>
  <div data-role="content">
    ...
  </div>
</div>



sample/dialog.html
http://d.hatena.ne.jp/pikotea/20101019/
• <a data-role="button">
• <button>
‣ <input type="">
  - button
  - submit
  - reset
  - image
•               : data-role="inline"
•                          : class="ui-bar"
‣                : data-icon

    •   arrow-l

    •   etc...

‣                       : data-iconpos

    •   left

    •   right

    •   notext

    •   etc...
• <input type="">
 - text
 - search
 - range
• <textarea>
• data-role="fieldcontain"   label




    width < 480px            width >= 480px
<!--   data-role="fieldcontain"   label     -->
<div data-role="fieldcontain">
  <label for="text-search">    :</label>
  <input type="search" id="text-search"
placeholder="        ...">
</div>
‣ <input type="">
  - checkbox
  - radio
•         <label>
•                  : data-role="controlgroup"

    -   button
    -   checkbox
    -   radio
    -   select

•              : data-type
    -   vertical
    -   horizontal
•                        : <select
    data-role="slider"><option>
         ×2

‣                        : <select>
    -
    -           : data-native-
        menu="false"
• <div data-role="collapsible">
•            : data-collapsed

  - : false
  -         : true

• data-collapsible-set :
1
•              : <ul data-role="listview">

    -
    -
    -                : <li><a>
    -
    -
•
    -              : <li>
        divider="true"
                              data-list-

    -
    -
    -             : <li><img>
    -
    -       : <li><span class="ui-li-
        aside">
    -
2
•                : <ul data-role="listview">

    -
    -
    -
    -
    -
•
    -
    -
    -
    -
    -             : <li><img class="ui-li-
        icon">
    -
    -      : <ul data-inset="true"
3
•              : <ol data-role="listview">

    -
    -                     <ol>
    -
    -                : <li><ul>
    -
•
    -
    -                  : <li><span
        class="ui-li-count">
    -
    -
    -
    -
    -
4
•       : <ul data-role="listview">

    -
    -
    -
    -
    -              : <li>2            <a>



•
    -
    -
    -         : data-filster="true"
    -
    -
    -
    -
•                     :
      data-fullscreen="true"

•                     :
                          data-
    position="fixed"
•                           :


    <div data-
    role="navbar"><ul><li><
    a>
•
‣ <div class="ui-grid-a">
  - <div class="ui-block-a">
  - <div class="ui-block-b">
jQuery Mobileではじめるモバイルサイト/アプリ制作
•   data-theme

•                "a"   "e" 4

•                              "f" "z"
•
    ★ThemeRoller
    ★
ThemeRoller
jQuery Mobile




    http://jquerymobile.com/themeroller/
ThemeRoller
•
•
•                                  30

•
• Adobe Kuler   http://kuler.adobe.com/
ThemeRoller
jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作
Demo




http://jquerymobile.com/themeroller/index.php?style_id=20111212-57   30
jQuery Mobile

<link rel="stylesheet" href="http://code.jquery.com/mobile/
1.0/jquery.mobile-1.0.min.css" />
<link rel="stylesheet" href="custom.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></
script>
<script src="http://code.jquery.com/mobile/1.0/
jquery.mobile-1.0.min.js"></script>
data-theme

<div data-role="page" data-theme="f">
  <div data-role="header" data-theme="f">
    ...
  </div>
  <div data-role="content">
    ...
  </div>
</div>
ThemeRoller

1.
     ThemeRoller

2.
iOS




http://taitems.tumblr.com/post/7240874402/ios-inspired-jquery-mobile-theme-jquery-mobile
•
    ✦
    ✦
    ✦
    ✦
DOM




Chrome
• Internet Explorer -
• Chrome -
• Firefox - firebug
• Opera - Dragonfly
•                     Dreamweaver
jQuery Mobileではじめるモバイルサイト/アプリ制作
1. <h1>


2.

3.


4.
Demo
<h1>
.ui-header .ui-title, .ui-footer .ui-title {
  min-height: 1.1em;
  text-align: center;
  font-size: 16px;
  display: block;
  margin: .6em 90px .8em;
  padding: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  outline: 0!important;
}
<link rel="stylesheet" href="http://code.jquery.com/mobile/
1.0/jquery.mobile-1.0.min.css" />
<style>
.ui-header .ui-title {
  margin: .6em 45px .8em;
}
</style>
jQuery Mobileではじめるモバイルサイト/アプリ制作
.ui-btn-corner-all {
  -moz-border-radius: 1em;
  -webkit-border-radius: 1em;
  border-radius: 1em;
}
ID

<a href="#" data-role="button" id="btn1" >    1</a>



<link rel="stylesheet" href="http://code.jquery.com/mobile/
1.0/jquery.mobile-1.0.min.css" />
<style>
#btn1.ui-btn-corner-all {
  -moz-border-radius: 1em;
  -webkit-border-radius: 1em;
  border-radius: 1em;
}
</style>
DOM
              ex) <input>
<input type="button" value="     2" id="btn2">


<div data-theme="c" class="ui-btn ui-btn-corner-all ui-shadow
ui-btn-up-c" aria-disabled="false">
  <span class="ui-btn-inner ui-btn-corner-all" aria-
hidden="true">
    <span class="ui-btn-text">     2</span>
  </span>
  <input type="button" value="     2" id="btn2" class="ui-btn-
hidden" aria-disabled="false">
</div>
jQuery Mobileではじめるモバイルサイト/アプリ制作
"ui-btn-active"
<div data-role="navbar">
  <ul>
    <li><a href="#" class="ui-btn-active">Menu1</a></li>
    <li><a href="#page2" data-transition="fade">Menu2</a></li>
    <li><a href="#page3" data-transition="fade">Menu3</a></li>
  </ul>
</div>
ui-body-a
ui-bar-a
ui-btn-active
ui-btn-up-a
ui-btn-down-a
ui-btn-hover-a
ui-corner-all
ui-corner-top
ui-corner-bottom
• <div>
 - ui-body-e
 - ui-corner-all
jQuery Mobile



                                       anything!


<input type="button" value="   1" data-role="none" >
jQuery Mobile Gallery




    http://www.jqmgallery.com/
Web
      API
jQuery Mobile
jQuery    jQuery Mobile

<link rel="stylesheet" href="jquery.mobile.css" />
<script src="jquery.js"></script>
<!-- jQuery jQuery Mobile             -->
<script>
$(document).bind("mobileinit", function(){
	 $.mobile.foo = bar;
});
</script>
<script src="jquery.mobile.js"></script>
1
$.mobile
loadingMessage
                                ajax
       : "loading"


pageLoadErrorMessage
                                       ajax
       : "Error Loading Page"
2
$.mobile
touchOverflowEnabled
overflow-scrolling: touch
                              iOS5
           : true



pushStateEnabled
URL                        history.pushState
                    URL
           : true
3
$.mobile
ajaxEnabled
                ajax
       : true
UI
<link rel="stylesheet" href="jquery.mobile.css" />
<script src="jquery.js"></script>
<!-- jQuery jQuery Mobile             -->
<script>
$(document).bind("mobileinit", function(){
	
	 //data-role="page"
	 $.mobile.page.prototype.options.foo = bar;

});
</script>
<script src="jquery.mobile.js"></script>
//
$.mobile.page.prototype.options.backBtnText = '   ';



<!--                                 -->
<div data-role="page" data-back-btn-text="   ">
  ...
</div>


※                           data
//
$(document).bind('mobileinit', function(){

     //
     $.mobile.loadingMessage = '         ';
     $.mobile.pageLoadErrorMessage = '                    ';
     $.mobile.dialog.prototype.options.closeBtnText = '        ';
     $.mobile.selectmenu.prototype.options.closeText= '        ';
     $.mobile.listview.prototype.options.filterPlaceholder = '
          ';
     $.mobile.page.prototype.options.backBtnText = '      ';
});
jQuery Mobile   API
API1
$.mobile.changePage(to, options)

•       to:
        URL
        jQuery                $(‘#pageid’)

•       options                       :
    -         type           :”get”
                  get post
    -         data


    -         transition          :


    -         reverse           : false


    -         changeHash                  : true


    -         reloadPageI                 : false
$.mobile.changePage(to, options)
// id="next"
$.mobile.changePage('#next');

//
$.mobile.changePage('next.html', {
	 type: 'get',
	 data: $('#formId').serialize() //
});

//       pop
$.mobile.changePage('#next', {
  transition: 'pop',
  changeHash: false
});
API2
$.mobile.showPageLoadingMsg()


$.mobile.hidePageLoadingMsg()
$.mobile.showPageLoadingMsg()
$.mobile.hidePageLoadingMsg()
//
$.mobile.showPageLoadingMsg();

//                 :
var list = $('#listview-id'); //
for ( var i = 0; i < 10; i++ ) {
    list.append($('<li>            ' + i + '</li>'));
}
list.listview('refresh');


//
$.mobile.hidePageLoadingMsg();
API3
$.mobile.silentScroll(yPos)
        y

•   yPos           :
    y         :0
$.mobile.silentScroll(yPos)
//
$.mobile.silentScroll();

//
$.mobile.silentScroll($('#target').position().top);
UI    API1
page()


button(method)

•    method      :
    - refresh
                      β1
    - enable

    - disable
page()
//
$('#target').append($('<input type="button" value="   ">'));
$('#target').page();


button()
//
$('#buttonid').button('disable');
UI   API2
dialog(method)

•    method        :
    - close


listveiw(method)

•    method        :
    - refresh
jQuery Mobile
•                              -   pageinit

    -                          -   pagebeforeshow

    -
        tap
                               -   pagebeforehide

    -
        taphold
                               -   pageshow

    -
        swipe
        swipeleft
                               -   pagehide

    -   swiperight         •
•                              -   pagebeforechange

    -                          -   pagechange

    -
        scrollstart
        scrollstop
                               -   pagechangefailed

•                          •
    -                          -   mobileinit

    -
        pagebeforecreate
                               -   orientationchange
        pagecreate
                               -   throttledresize
1
mobileinit
jQuery Mobile                                jQuery Mobile



//jQuery Moible
$(document).bind('mobileinit', function(){
	
	 //
	 $.mobile.loadingMessage = '        ';
});
2
pagebeforecreate         pagecreate

         1

//
$('#pageId').bind("pagebeforecreate", function(evt){
	
	 //
     //Home
  $('#target').append('<a href="#home" data-role="button"
data-icon="home" data-iconpos="notext">Home</a>');

	
	 //false
  //return false;
});
3
pagebeforechange   pagechange


                       pagebeforecreate   pagebeforeshow



pagechangefailed
pagebeforeload
pageload pageloadfailed
pagebeforecreate
pagecreate
pageinit
pagebeforechange
pagebeforeshow
pageshow
pagechange pagechangefailed
//
$(document).ready( function(){

	 $(':jqmData(role=page)').live("pagebeforecreate", function
(evt){
	 	
	 	 //
	 	 $(this).find(':jqmData(role=header)').append(
	 	 	 $('<a href="#main" data-role="button" data-icon="home"
data-iconpos="notext" class="ui-btn-right">Home</a>')
	 	 );
	 });
});
<div data-role="page" data-dom-cache="true">...</a>




<a href="next.html" data-prefetch>...</a>




> git clone git://github.com/jquery/jquery-mobile.git
build.xml
> cd jquery-mobile
> make
jQuery Mobileではじめるモバイルサイト/アプリ制作
PhoneGap
Web




        http://phonegap.com/
PhoneGap
• Web                      HTML/CSS/
    JavaScript



• One source     Android   iPhone



•

• Dreamweaver CS5.5
PhoneGap Build

PhoneGap Build




https://build.phonegap.com/
• git

• zip
  index.html
• iPhone
jQuery Mobileではじめるモバイルサイト/アプリ制作
Demo
PhoneGap
• HTML/CSS/JavaScript


•


• PhoneGap Build
jQuery Mobile
    Publickey




http://www.publickey1.jp/m/   http://kokucheese.com/s/
jQuery Mobile
Final fantasy XI Forum




 http://forum.square-enix.com/ffxi/
                                      http://www.junkudo.jp/
             forum.php
jQuery Mobile
WALLPAPER COLLECTION




   http://machiuke.v-colors.com/   http://baito.mynavi.jp/sp/
jQuery Mobile
     Design Spice




     http://design-spice.com/
jQuery Mobile


• jQuery Mobile

•                 UI

• Date Picker          UI
Thank You!!
Toru Yoshikawa ( @yoshikawa_t )
http://jquerymobile.com/


http://jquerymobile.com/demos/

jQuery Mobile
http://d.hatena.ne.jp/pikotea/20101019/

jQuery Mobile
http://dev.screw-axis.com/doc/jquery_mobile/

jQuery Mobile
http://www.jqmgallery.com/
jQuery Mobile
http://www.adobe.com/jp/joc/devnet/dreamweaver/articles/jq_snippets.html

Github jquery-mobile
https://github.com/jquery/jquery-mobile

More Related Content

PDF
Intro to jQuery UI
PPTX
Entwurfsmuster für mobile JavaScript-Web-Apps - WebTechConference 2012
TXT
DestakNews
PPTX
Entwurfsmuster für mobile JavaScript-Web-Apps – Mobile Tech Conference 2012 A...
KEY
jQuery入門
PPTX
JavaScript Data Binding mit jQuery Mobile - MobileTech Conference Spring 2012
PDF
jQuery プラグイン作成入門
DOCX
Intro to jQuery UI
Entwurfsmuster für mobile JavaScript-Web-Apps - WebTechConference 2012
DestakNews
Entwurfsmuster für mobile JavaScript-Web-Apps – Mobile Tech Conference 2012 A...
jQuery入門
JavaScript Data Binding mit jQuery Mobile - MobileTech Conference Spring 2012
jQuery プラグイン作成入門

What's hot (7)

PDF
Jquery Framework
PPTX
JavaScript Data Binding mit jQuery Mobile - Mobile Developer Conference 2012 ...
TXT
Template ku
TXT
New text document (2) 2
TXT
Blogger template-squeeze-page-angelogrande
TXT
Amp html blogger templates
PDF
Get more votes!
Jquery Framework
JavaScript Data Binding mit jQuery Mobile - Mobile Developer Conference 2012 ...
Template ku
New text document (2) 2
Blogger template-squeeze-page-angelogrande
Amp html blogger templates
Get more votes!
Ad

Viewers also liked (20)

PDF
見やすいプレゼン資料の作り方 - リニューアル増量版
PPT
「らふらく^^」というブログについて
PPT
素敵なプレゼン資料を作るためのKnow-Howてんこ盛りセッション:プレゼン道場 Ver 2.2
PDF
【プレゼン】見やすいプレゼン資料の作り方【初心者用】
PDF
ビジネスマン必見!キレイな提案書を作るためのデザインの基礎知識
PDF
0528 kanntigai ui_ux
PDF
女子の心をつかむUIデザインポイント - MERY編 -
PPT
色彩センスのいらない配色講座
PDF
HTML5勉強会#23_GeoHex
KEY
Device系APIの全体図
PDF
20120219i phonedeveloperworkshoppublished
PDF
ウェブサービスのつくりかた
PDF
HoloLens をかぶってパンを食べに行った話
PPTX
Microsoft hololens
PDF
社内Slackを使ってなんか分析してみた話
PDF
MS Officeファイル暗号化のマスター鍵を利用したバックドアとその対策
PDF
【個人アカウントとfacebookページの違い】
PPTX
エンジニアの情報収集
PPTX
お肉が食べたいプレゼン
PDF
人生が変わる人続出!あなたも参加できるITコミュニティ活動
見やすいプレゼン資料の作り方 - リニューアル増量版
「らふらく^^」というブログについて
素敵なプレゼン資料を作るためのKnow-Howてんこ盛りセッション:プレゼン道場 Ver 2.2
【プレゼン】見やすいプレゼン資料の作り方【初心者用】
ビジネスマン必見!キレイな提案書を作るためのデザインの基礎知識
0528 kanntigai ui_ux
女子の心をつかむUIデザインポイント - MERY編 -
色彩センスのいらない配色講座
HTML5勉強会#23_GeoHex
Device系APIの全体図
20120219i phonedeveloperworkshoppublished
ウェブサービスのつくりかた
HoloLens をかぶってパンを食べに行った話
Microsoft hololens
社内Slackを使ってなんか分析してみた話
MS Officeファイル暗号化のマスター鍵を利用したバックドアとその対策
【個人アカウントとfacebookページの違い】
エンジニアの情報収集
お肉が食べたいプレゼン
人生が変わる人続出!あなたも参加できるITコミュニティ活動
Ad

More from yoshikawa_t (20)

PDF
Ionicで作るTechfeed
PDF
困った時のDev toolsの使い方(初心者向け)
PDF
TechFeedというテクノロジーキュレーションサービスを作った話
PDF
Chrome DevTools Awesome 10 Features +1
PDF
これからのモバイルWebと最新動向
PDF
いまさら聞けないHTML5概要
PDF
オフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like database
PDF
jQuery Mobile is not dead!
PDF
HTML5開発最前線
PDF
Chrome Apps のデバイスAPI
PDF
Chrome Apps & Chromeウェブストア概要
PDF
Chrome DevTools for beginners v1.2
PDF
モバイル時代のWebパフォーマンス
PDF
モバイル時代のWebパフォーマンスTips
PDF
Chrome apps for mobile 概要
PDF
Chrome Apps 概要
PDF
Chrome Devtools for beginners (v1.1)
PDF
Html5概要 & デモ
PDF
いまさら聞けないCSSレイアウト入門
PDF
Sencha touch vs j query mobile
Ionicで作るTechfeed
困った時のDev toolsの使い方(初心者向け)
TechFeedというテクノロジーキュレーションサービスを作った話
Chrome DevTools Awesome 10 Features +1
これからのモバイルWebと最新動向
いまさら聞けないHTML5概要
オフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like database
jQuery Mobile is not dead!
HTML5開発最前線
Chrome Apps のデバイスAPI
Chrome Apps & Chromeウェブストア概要
Chrome DevTools for beginners v1.2
モバイル時代のWebパフォーマンス
モバイル時代のWebパフォーマンスTips
Chrome apps for mobile 概要
Chrome Apps 概要
Chrome Devtools for beginners (v1.1)
Html5概要 & デモ
いまさら聞けないCSSレイアウト入門
Sencha touch vs j query mobile

jQuery Mobileではじめるモバイルサイト/アプリ制作