SlideShare a Scribd company logo
Mobile
HTML, CSS, JavaScript
       David Calhoun
Mobile HTML, CSS, and JavaScript
Viewport Meta Tag




   :(        :)
Viewport Meta Tag

<meta name="viewport"
content="width=device-width"/>
URI Schemes




href="sms:18005555555"   href="tel:18005555555"
Home Screen Icon




          Android too!
Home Screen Icon

<link rel="apple-touch-icon"
href="icon.png"/>
Full Screen Flag (iOS)


         vs
Full Screen Flag (iOS)


<meta name="apple-mobile-web-
app-capable" content="yes"/>
Splash Screen (iOS)
       <link rel="apple-touch-
       startup-image"
       href="startup.png"/>
Status Bar Style
Default         Black
Status Bar Style

<meta name="apple-mobile-web-
app-status-bar-style"
content="black"/>
<input type=”search”>
<input type=”tel”>
<input type=”email”>
Media Capture




                3.0
Media Capture

• Opens straight to the camera or
  microphone for file input




                                    3.0
Media Capture

 • Opens straight to the camera or
    microphone for file input

<input type="file" accept="image/*;capture=camera"/>




                                                       3.0
Media Capture

 • Opens straight to the camera or
    microphone for file input

<input type="file" accept="image/*;capture=camera"/>
<input type="file" accept="video/*;capture=camcorder"/>




                                                          3.0
Media Capture

 • Opens straight to the camera or
    microphone for file input

<input type="file" accept="image/*;capture=camera"/>
<input type="file" accept="video/*;capture=camcorder"/>
<input type="file" accept="audio/*;capture=microphone"/>




                                                           3.0
The Joys of Autocorrect
Controlling autocorrect
<input autocorrect="off"
autocomplete="off"
autocapitalize="off"/>
Mobile HTML, CSS, and JavaScript
Media Queries

• based on screen size and device size
• based on orientation
• based on screen resolution
• etc...
Media Queries
@media   all and (max-width: 480px) {
  body   { }
}
@media   all and (max-device-width: 480px) { }
@media   all and (orientation: portrait) { }
tap-highlight-color
        .no-highlight {
          -webkit-tap-highlight-color:
        transparent;
        }

        .red-highlight {
          -webkit-tap-highlight-color:
        red;
        }
user-select

     .no-user-select {
       -webkit-user-select: none;
       -moz-user-select: none;
       user-select: none;
     }




                      ?
touch-callout

                   .no-callout {
                     -webkit-touch-callout:
                   none;
                   }




Default behavior
JavaScript
Touch Events

         • touchstart
         • touchmove
         • touchend
         • (touchcancel)
Touch Events
document.addEventListener('touchstart',
function(e){
  //e.touches
  //e.changedTouches
}, false);




http://frontendstuff.com/javascript/examples/touch.html
Gesture Events (iOS)

            • iOS only
            • 2+ fingers
            • gesturestart
            • gesturechange
            • gestureend
Gesture Events (iOS)
  document.addEventListener('gesturestart',
  function(e){
    //e.scale
    //e.rotation
  }, false);




http://frontendstuff.com/javascript/examples/gesture.html
orientationchange
// fired every 90 degrees of rotation
window.addEventListener('orientationchange',
function(e){
  //window.orientation (0 is portrait, 90 and
-90 are landscape)
}, false);
deviceorientation
   • taps into the gyroscope
   • not just every 90 degrees



                                                  3.0       4.2
http://frontendstuff.com/javascript/examples/deviceorientation.html
deviceorientation

// fired a LOT
window.addEventListener('deviceorientation', function(e){
  //e.alpha;
  //e.beta;
  //e.gamma;
}, false);
devicemotion
                                         • taps into accelerometer
                                         • practical application: shake
                                              gesture?




                                                                3.0           4.2
http://developer.apple.com/library/safari/#documentation/SafariDOMAdditions/Reference/
        DeviceMotionEventClassRef/DeviceMotionEvent/DeviceMotionEvent.html
devicemotion
 window.addEventListener('devicemotion', function (e){
   // e.accelerationIncludingGravity.x
   // e.accelerationIncludingGravity.y
   // e.accelerationIncludingGravity.z
 }, false);




http://frontendstuff.com/javascript/examples/devicemotion.html
window.devicePixelRatio
window.devicePixelRatio


• 1.5 (Nexus One, etc.)
• 2 (iPhone 4, etc.)
navigator.connection
     (Android)
  {
      "type": "3",
      "UNKNOWN": "0",
      "ETHERNET": "1",
      "WIFI": "2",
      "CELL_2G": "3",
      "CELL_3G": "4"
  }                      2.2
navigator.connection
       (Android)

navigator.connection.CELL_3G
navigator.connection.CELL_2G
navigator.connection.WIFI
Mobile JavaScript Libraries




                       and much more...

  http://davidbcalhoun.com/2010/mobile-javascript-libraries-and-frameworks
Photo Credits
   •   http://www.flickr.com/photos/kk/106960641/

   •   http://www.flickr.com/photos/geirarne/110995239/

   •   http://www.flickr.com/photos/aldrin_muya/3133715902/

   •   http://crockfordfacts.com/

   •   http://www.flickr.com/photos/equanimity/535648833/

   •   http://www.flickr.com/photos/71518947@N00/4698968858/
That’s All Folks!
• Twitter: @franksvalli
• SpeakerRate: http://bit.ly/hMEEfo
Ad

Recommended

WordPress and Ajax
WordPress and Ajax
Ronald Huereca
 
Ajax Security
Ajax Security
Joe Walker
 
jQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & Tricks
Addy Osmani
 
High Performance Ajax Applications
High Performance Ajax Applications
Julien Lecomte
 
How to make Ajax work for you
How to make Ajax work for you
Simon Willison
 
Maintainable JavaScript 2012
Maintainable JavaScript 2012
Nicholas Zakas
 
jQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
SocketStream
SocketStream
Paul Jensen
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
Fabien Potencier
 
Building Web Sites that Work Everywhere
Building Web Sites that Work Everywhere
Doris Chen
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
Nicholas Zakas
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Building scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
Paul Irish
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
WebFrameworks
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
Doris Chen
 
the 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp II
Dirk Ginader
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
Matt Raible
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
jeresig
 
Dan Webb Presentation
Dan Webb Presentation
RubyOnRails_dude
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Patrick Lauke
 
Enjoy the vue.js
Enjoy the vue.js
TechExeter
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
Remy Sharp
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
James Pearce
 
Symfony2 and AngularJS
Symfony2 and AngularJS
Antonio Peric-Mazar
 
Understanding & Designing for the Mobile Web
Understanding & Designing for the Mobile Web
WebFX
 
The Mobile Inbox 201: Design & Coding
The Mobile Inbox 201: Design & Coding
Salesforce Marketing Cloud
 

More Related Content

What's hot (20)

Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
Fabien Potencier
 
Building Web Sites that Work Everywhere
Building Web Sites that Work Everywhere
Doris Chen
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
Nicholas Zakas
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Building scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
Paul Irish
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
WebFrameworks
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
Doris Chen
 
the 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp II
Dirk Ginader
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
Matt Raible
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
jeresig
 
Dan Webb Presentation
Dan Webb Presentation
RubyOnRails_dude
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Patrick Lauke
 
Enjoy the vue.js
Enjoy the vue.js
TechExeter
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
Remy Sharp
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
James Pearce
 
Symfony2 and AngularJS
Symfony2 and AngularJS
Antonio Peric-Mazar
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
Fabien Potencier
 
Building Web Sites that Work Everywhere
Building Web Sites that Work Everywhere
Doris Chen
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
Nicholas Zakas
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Building scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
Paul Irish
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
WebFrameworks
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
Doris Chen
 
the 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp II
Dirk Ginader
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
Matt Raible
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
jeresig
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Getting touchy - an introduction to touch events / Web Standards Days / Mosco...
Patrick Lauke
 
Enjoy the vue.js
Enjoy the vue.js
TechExeter
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
Remy Sharp
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
James Pearce
 

Viewers also liked (20)

Understanding & Designing for the Mobile Web
Understanding & Designing for the Mobile Web
WebFX
 
The Mobile Inbox 201: Design & Coding
The Mobile Inbox 201: Design & Coding
Salesforce Marketing Cloud
 
Web 2 sms corporate
Web 2 sms corporate
Sutardjo ( Mang Ojo )
 
Kullanilabilirlik Sözlüğü
Kullanilabilirlik Sözlüğü
Userspots
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
Estelle Weyl
 
HRA Coalition Letter (June 15, 2016)
HRA Coalition Letter (June 15, 2016)
PeopleKeep
 
Refactoring out of the mess
Refactoring out of the mess
wolframkriesing
 
ES6Katas.org - an introduction and the story behind
ES6Katas.org - an introduction and the story behind
wolframkriesing
 
завуч и директор
завуч и директор
Olga Gorbenko
 
Presentationfor lnl
Presentationfor lnl
WebFX
 
Frontend Engineer Toolbox
Frontend Engineer Toolbox
Ynon Perek
 
САЙТ ГИМНАЗИИ
САЙТ ГИМНАЗИИ
Olga Gorbenko
 
Kontseptsiya nova shkola
Kontseptsiya nova shkola
Olga Gorbenko
 
Hard-Won Lessons In Responsive Email Design - SmashingConf Oxford 2014
Hard-Won Lessons In Responsive Email Design - SmashingConf Oxford 2014
Fabio Carneiro
 
02 JavaScript Syntax
02 JavaScript Syntax
Ynon Perek
 
Context Switching
Context Switching
franksvalli
 
Arquitectura protoracionalista
Arquitectura protoracionalista
carolina gastelum
 
43 Inspirational Mobile Splash Screens
43 Inspirational Mobile Splash Screens
Pocket Your Shop
 
Mobile html5 today
Mobile html5 today
Ido Green
 
System Analysis and Design Proposal presentation
System Analysis and Design Proposal presentation
Leslie Ybañez
 
Understanding & Designing for the Mobile Web
Understanding & Designing for the Mobile Web
WebFX
 
Kullanilabilirlik Sözlüğü
Kullanilabilirlik Sözlüğü
Userspots
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
Estelle Weyl
 
HRA Coalition Letter (June 15, 2016)
HRA Coalition Letter (June 15, 2016)
PeopleKeep
 
Refactoring out of the mess
Refactoring out of the mess
wolframkriesing
 
ES6Katas.org - an introduction and the story behind
ES6Katas.org - an introduction and the story behind
wolframkriesing
 
завуч и директор
завуч и директор
Olga Gorbenko
 
Presentationfor lnl
Presentationfor lnl
WebFX
 
Frontend Engineer Toolbox
Frontend Engineer Toolbox
Ynon Perek
 
САЙТ ГИМНАЗИИ
САЙТ ГИМНАЗИИ
Olga Gorbenko
 
Kontseptsiya nova shkola
Kontseptsiya nova shkola
Olga Gorbenko
 
Hard-Won Lessons In Responsive Email Design - SmashingConf Oxford 2014
Hard-Won Lessons In Responsive Email Design - SmashingConf Oxford 2014
Fabio Carneiro
 
02 JavaScript Syntax
02 JavaScript Syntax
Ynon Perek
 
Context Switching
Context Switching
franksvalli
 
Arquitectura protoracionalista
Arquitectura protoracionalista
carolina gastelum
 
43 Inspirational Mobile Splash Screens
43 Inspirational Mobile Splash Screens
Pocket Your Shop
 
Mobile html5 today
Mobile html5 today
Ido Green
 
System Analysis and Design Proposal presentation
System Analysis and Design Proposal presentation
Leslie Ybañez
 
Ad

Similar to Mobile HTML, CSS, and JavaScript (20)

Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)
Adam Lu
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
Critical Mass
 
Make mobile web apps rock
Make mobile web apps rock
Chris Love
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
rit2011
 
Responsive websites. Toolbox
Responsive websites. Toolbox
Wojtek Zając
 
Creating mobile apps without native code
Creating mobile apps without native code
Joakim Kemeny
 
Fake it 'til you make it
Fake it 'til you make it
Jonathan Snook
 
Google Chrome DevTools for Mobile Screencast and Emulation
Google Chrome DevTools for Mobile Screencast and Emulation
Anshul Mehta
 
Google chrome dev tools for mobile screencast and emulation
Google chrome dev tools for mobile screencast and emulation
Anshul Mehta
 
Web app and more
Web app and more
faming su
 
Web Apps and more
Web Apps and more
Yan Shi
 
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Patrick Lauke
 
The Mobile Development Landscape
The Mobile Development Landscape
Ambert Ho
 
Js On Mobile Devices
Js On Mobile Devices
Jens Arps
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Patrick Lauke
 
Mobile App Development
Mobile App Development
Chris Morrell
 
Phonegap deep-dive
Phonegap deep-dive
alunny
 
Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
Daum DNA
 
Smau milano 2012 arena social media emanuele-bolognesi
Smau milano 2012 arena social media emanuele-bolognesi
SMAU
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)
Adam Lu
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
Critical Mass
 
Make mobile web apps rock
Make mobile web apps rock
Chris Love
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
rit2011
 
Responsive websites. Toolbox
Responsive websites. Toolbox
Wojtek Zając
 
Creating mobile apps without native code
Creating mobile apps without native code
Joakim Kemeny
 
Fake it 'til you make it
Fake it 'til you make it
Jonathan Snook
 
Google Chrome DevTools for Mobile Screencast and Emulation
Google Chrome DevTools for Mobile Screencast and Emulation
Anshul Mehta
 
Google chrome dev tools for mobile screencast and emulation
Google chrome dev tools for mobile screencast and emulation
Anshul Mehta
 
Web app and more
Web app and more
faming su
 
Web Apps and more
Web Apps and more
Yan Shi
 
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Patrick Lauke
 
The Mobile Development Landscape
The Mobile Development Landscape
Ambert Ho
 
Js On Mobile Devices
Js On Mobile Devices
Jens Arps
 
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Making your site mobile-friendly - DevCSI Reading 21.07.2010
Patrick Lauke
 
Mobile App Development
Mobile App Development
Chris Morrell
 
Phonegap deep-dive
Phonegap deep-dive
alunny
 
Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
Daum DNA
 
Smau milano 2012 arena social media emanuele-bolognesi
Smau milano 2012 arena social media emanuele-bolognesi
SMAU
 
Ad

Mobile HTML, CSS, and JavaScript

Editor's Notes