SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
jQuery Mobile2




   Inbal Geffen
data-role="button"
●      Add a button to anywhere in our page

<a href="#" data-role="button" data-icon="star" data-theme="a" id="button1">Button</a>

●      We can add this button to the header to create a header button

What can we change?
 ● data-icon
(http://jquerymobile.com/test/docs/buttons/buttons-icons.html)

●      data-iconpos
●      data-mini
●      data-inline




    Inbal Geffen
data-filter="true"
<div data-role="content">
             <ul data-role="listview" data-inset="true" data-filter="true">
                 <li><a href="#">Moran</a></li>
                 <li><a href="#">Bella</a></li>
                 <li><a href="#">Gila</a></li>
                 <li><a href="#">Ronit</a></li>
                 <li><a href="#">Michal</a></li>
             </ul>

</div>

Automatically adds a search view to our list




Inbal Geffen
jQuery + jQuery mobile
<div data-role="page">

        <div data-role="header" id="header">
              <h1>What is your name?</h1>
                     <a href="#" data-role="button" data-icon="delete" data-theme="a" id="clear">Clear</a>
        </div><!-- /header -->

        <div data-role="content">
                     <ul data-role="listview" data-inset="true" data-filter="true">
                           <li><a href="#">Moran</a></li>
                           <li><a href="#">Bella</a></li>
                           <li><a href="#">Gila</a></li>
                           <li><a href="#">Ronit</a></li>
                           <li><a href="#">Michal</a></li>
                     </ul>

        </div><!-- /content -->
        <div>
              <label for="basic" >Different Name:</label>
              <input type="text" name="name" id="freetext" value="" data-mini="true" />
        </div>

</div><!-- /page -->

Inbal Geffen
jQuery + jQuery mobile
<script>

       $(document).ready(function() {
     $("#freetext").focusout(function() {
        var str = 'hello '+$("#freetext").val();
        $("#header h1").text(str);
              });

               $("li a").click(function() {
                var str = 'hello '+$(this).text();
         $("#header h1").text(str);

          });

               $("#header a").click(function() {
         $("#header h1").text('What is your name?');

          });

   });

         </script>


Inbal Geffen
data-rel="dialog"
<!DOCTYPE html>
<html>
  <head>
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
  <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
</head>
<body>
<div data-role="page">
  <div data-role="header">
     <h1>Sample</h1>
  </div>
  <div data-role="content">
     <p></p>
     <p><a href="dialog.html" data-rel="dialog" data-role="button">Is this a question?</a></p>
  </div>
</div>
<div data-role="page" data-url="dialog.html">
  <div data-role="header">
     <h1>Dialog</h1>
  </div>
  <div data-role="content">
     <p>Is this an answer?</p>
  </div>
</div>
</body>                                                                  Ex:
</html>




Inbal Geffen
Links version 1 - different pages
Index.html

<!--Each page will start with a data-role="page"-->
<div data-role="page" id="home" data-theme="c">

<!--All the content in the page will be in the div with data-role="content"-->
     <div data-role="content">

            <div class="choice_list">
            <h1> This is page1 </h1>

          <ul data-role="listview" data-inset="true" >
          <li><a href="page2.html"><h3>Page 2</h3></a></li>
          <li><a href="page3.html"><h3>Page 3</h3></a></li>
          <li><a href="page4.html"><h3>Page 4</h3></a></li>
          </ul>
          </div>
     </div>
</div>
   Inbal Geffen
Transitions

   <li><a href="page2.html" data-transition="slidedown"><h3>Page 2</h3></a></li>
   <li><a href="page3.html" data-transition="slide"><h3>Page 3</h3></a></li>
   <li><a href="page4.html" data-transition="fade"><h3>Page 4</h3></a></li>


   More transitions: http://jquerymobile.com/demos/1.0a4.1/docs/pages/docs-transitions.
   html




Inbal Geffen
Links version 2 - multipage
Index.html

● We create all our "pages" in this single file

● Each page will start with a data-role="page" - Like before

● Single page will include several divs with data-role "page"

● So if we want 3 pages we will have 3 divs like this one, each with different id!!
<div data-role="page" id="one" data-theme="c">
.....
</div>
<div data-role="page" id="two" data-theme="c">
.....
</div>
<div data-role="page" id="three" data-theme="c">
.....
</div>

   Inbal Geffen
Links version 2 - multipage
Index.html

<div id="one" data-role="page">

    <div class="choice_list">
    <h1> Multi-page ONE! </h1>

    <ul data-role="listview" data-inset="true" >
         <li><a href="#two" data-transition="slide">Two</a></li>
         <li><a href="#three" data-transition="slide">Three</a></li>
    </ul>
    </div>

</div>

● We use the id we created as a page

● The first div with data-role="page" will be the first page in our website

   Inbal Geffen

Mais conteúdo relacionado

Mais procurados

Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
Epistemologia Y Etica
Epistemologia Y EticaEpistemologia Y Etica
Epistemologia Y Etica
guest975e56
 

Mais procurados (20)

Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
 
The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
1cst
1cst1cst
1cst
 
Cheap tricks for startups
Cheap tricks for startupsCheap tricks for startups
Cheap tricks for startups
 
実務導入に向けたAngularの始め方@Angular入門者の会
実務導入に向けたAngularの始め方@Angular入門者の会実務導入に向けたAngularの始め方@Angular入門者の会
実務導入に向けたAngularの始め方@Angular入門者の会
 
Epistemologia Y Etica
Epistemologia Y EticaEpistemologia Y Etica
Epistemologia Y Etica
 
Rails by example
Rails by exampleRails by example
Rails by example
 
React Under the Hood: Understanding React's UI Rendering Process
React Under the Hood: Understanding React's UI Rendering ProcessReact Under the Hood: Understanding React's UI Rendering Process
React Under the Hood: Understanding React's UI Rendering Process
 
非エンジニア系起業家のためのWebサービス開発授業 先生:森田 昌宏
非エンジニア系起業家のためのWebサービス開発授業 先生:森田 昌宏非エンジニア系起業家のためのWebサービス開発授業 先生:森田 昌宏
非エンジニア系起業家のためのWebサービス開発授業 先生:森田 昌宏
 
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
 
10. Imagini in MongoDB
10. Imagini in MongoDB10. Imagini in MongoDB
10. Imagini in MongoDB
 
google logo
google logogoogle logo
google logo
 
Cowboy development with Django
Cowboy development with DjangoCowboy development with Django
Cowboy development with Django
 
Don't Worry jQuery is very Easy:Learning Tips For jQuery
Don't Worry jQuery is very Easy:Learning Tips For jQueryDon't Worry jQuery is very Easy:Learning Tips For jQuery
Don't Worry jQuery is very Easy:Learning Tips For jQuery
 
Css pseudo classes
Css   pseudo classesCss   pseudo classes
Css pseudo classes
 
Pagination in PHP
Pagination in PHPPagination in PHP
Pagination in PHP
 
Css backgrounds
Css   backgroundsCss   backgrounds
Css backgrounds
 
Css colors
Css   colorsCss   colors
Css colors
 
Country State City Dropdown in PHP
Country State City Dropdown in PHPCountry State City Dropdown in PHP
Country State City Dropdown in PHP
 

Destaque (7)

Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
J queryui
J queryuiJ queryui
J queryui
 
Jquery2
Jquery2Jquery2
Jquery2
 
J querypractice
J querypracticeJ querypractice
J querypractice
 
jQuery mobile UX
jQuery mobile UXjQuery mobile UX
jQuery mobile UX
 
Web Storage & Web Workers
Web Storage & Web WorkersWeb Storage & Web Workers
Web Storage & Web Workers
 

Semelhante a Jquery mobile2

HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 
E2 appspresso hands on lab
E2 appspresso hands on labE2 appspresso hands on lab
E2 appspresso hands on lab
NAVER D2
 
E3 appspresso hands on lab
E3 appspresso hands on labE3 appspresso hands on lab
E3 appspresso hands on lab
NAVER D2
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
Andrei Hortúa
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan
 

Semelhante a Jquery mobile2 (20)

jQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisjQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveis
 
JQuery Mobile UI
JQuery Mobile UIJQuery Mobile UI
JQuery Mobile UI
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Choosing the Right Mobile Development Platform (Part 2)
Choosing the Right Mobile Development Platform (Part 2)Choosing the Right Mobile Development Platform (Part 2)
Choosing the Right Mobile Development Platform (Part 2)
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
 
E2 appspresso hands on lab
E2 appspresso hands on labE2 appspresso hands on lab
E2 appspresso hands on lab
 
E3 appspresso hands on lab
E3 appspresso hands on labE3 appspresso hands on lab
E3 appspresso hands on lab
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
 
HTML5
HTML5HTML5
HTML5
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Creating HTML Pages
Creating HTML PagesCreating HTML Pages
Creating HTML Pages
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
 
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using BootstrapStop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
iWebkit
iWebkitiWebkit
iWebkit
 
QCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UIQCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UI
 

Jquery mobile2

  • 1. jQuery Mobile2 Inbal Geffen
  • 2. data-role="button" ● Add a button to anywhere in our page <a href="#" data-role="button" data-icon="star" data-theme="a" id="button1">Button</a> ● We can add this button to the header to create a header button What can we change? ● data-icon (http://jquerymobile.com/test/docs/buttons/buttons-icons.html) ● data-iconpos ● data-mini ● data-inline Inbal Geffen
  • 3. data-filter="true" <div data-role="content"> <ul data-role="listview" data-inset="true" data-filter="true"> <li><a href="#">Moran</a></li> <li><a href="#">Bella</a></li> <li><a href="#">Gila</a></li> <li><a href="#">Ronit</a></li> <li><a href="#">Michal</a></li> </ul> </div> Automatically adds a search view to our list Inbal Geffen
  • 4. jQuery + jQuery mobile <div data-role="page"> <div data-role="header" id="header"> <h1>What is your name?</h1> <a href="#" data-role="button" data-icon="delete" data-theme="a" id="clear">Clear</a> </div><!-- /header --> <div data-role="content"> <ul data-role="listview" data-inset="true" data-filter="true"> <li><a href="#">Moran</a></li> <li><a href="#">Bella</a></li> <li><a href="#">Gila</a></li> <li><a href="#">Ronit</a></li> <li><a href="#">Michal</a></li> </ul> </div><!-- /content --> <div> <label for="basic" >Different Name:</label> <input type="text" name="name" id="freetext" value="" data-mini="true" /> </div> </div><!-- /page --> Inbal Geffen
  • 5. jQuery + jQuery mobile <script> $(document).ready(function() { $("#freetext").focusout(function() { var str = 'hello '+$("#freetext").val(); $("#header h1").text(str); }); $("li a").click(function() { var str = 'hello '+$(this).text(); $("#header h1").text(str); }); $("#header a").click(function() { $("#header h1").text('What is your name?'); }); }); </script> Inbal Geffen
  • 6. data-rel="dialog" <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>Sample</h1> </div> <div data-role="content"> <p></p> <p><a href="dialog.html" data-rel="dialog" data-role="button">Is this a question?</a></p> </div> </div> <div data-role="page" data-url="dialog.html"> <div data-role="header"> <h1>Dialog</h1> </div> <div data-role="content"> <p>Is this an answer?</p> </div> </div> </body> Ex: </html> Inbal Geffen
  • 7. Links version 1 - different pages Index.html <!--Each page will start with a data-role="page"--> <div data-role="page" id="home" data-theme="c"> <!--All the content in the page will be in the div with data-role="content"--> <div data-role="content"> <div class="choice_list"> <h1> This is page1 </h1> <ul data-role="listview" data-inset="true" > <li><a href="page2.html"><h3>Page 2</h3></a></li> <li><a href="page3.html"><h3>Page 3</h3></a></li> <li><a href="page4.html"><h3>Page 4</h3></a></li> </ul> </div> </div> </div> Inbal Geffen
  • 8. Transitions <li><a href="page2.html" data-transition="slidedown"><h3>Page 2</h3></a></li> <li><a href="page3.html" data-transition="slide"><h3>Page 3</h3></a></li> <li><a href="page4.html" data-transition="fade"><h3>Page 4</h3></a></li> More transitions: http://jquerymobile.com/demos/1.0a4.1/docs/pages/docs-transitions. html Inbal Geffen
  • 9. Links version 2 - multipage Index.html ● We create all our "pages" in this single file ● Each page will start with a data-role="page" - Like before ● Single page will include several divs with data-role "page" ● So if we want 3 pages we will have 3 divs like this one, each with different id!! <div data-role="page" id="one" data-theme="c"> ..... </div> <div data-role="page" id="two" data-theme="c"> ..... </div> <div data-role="page" id="three" data-theme="c"> ..... </div> Inbal Geffen
  • 10. Links version 2 - multipage Index.html <div id="one" data-role="page"> <div class="choice_list"> <h1> Multi-page ONE! </h1> <ul data-role="listview" data-inset="true" > <li><a href="#two" data-transition="slide">Two</a></li> <li><a href="#three" data-transition="slide">Three</a></li> </ul> </div> </div> ● We use the id we created as a page ● The first div with data-role="page" will be the first page in our website Inbal Geffen