• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. Firefox OS apps
  5. Firefox OS Building Blocks
  6. Value selector
  7. Value selector 2.0 implementation

Value selector 2.0 implementation

In This Article
    1. Live sample
    2. Code
      1. CSS
      2. HTML

This article gives you all you need to implement a v2.0 Gaia Value Selector in your own app.

Live sample

The following gives you an idea of what a rendered Value Selector would look like.

Code

Here is the code you'll need.

CSS

<link href="(your styles folder)/style/value_selector.css" rel="stylesheet" type="text/css">

The CSS can be found in the Gaia project 2.0 branch under shared/style/value_selector.css. Copy this into your own project, along with the associated resources.

HTML

Note: The CSS inside the <style> element isn't needed for the implementation: it is just for the purposes of this example.

<!doctype html>
<html>
<head>
  <link href="https://mdn.github.io/gaia-2.0-bb/value_selector.css" rel="stylesheet" type="text/css">
  <link href="https://gaia-components.github.io/gaia-icons/gaia-icons-embedded.css" rel="stylesheet" type="text/css">
  <style>
    html, body { font-size: 10px; margin: 0; padding: 0; font-family: sans-serif }
  </style>
</head>
<body>
  <form role="dialog" data-type="value-selector">
    <section class="scrollable">
      <h1>Select</h1>
      <ol role="listbox">
        <li role="option"><label role="presentation"> <span>None</span></label></li>
        <li role="option"><label role="presentation"> <span>At time of event</span></label></li>
        <li role="option"><label role="presentation"> <span>5 minutes before</span></label></li>
        <li role="option"><label role="presentation"> <span>15 minutes before</span></label></li>
        <li role="option" aria-selected="true"><label role="presentation"> <span>30 minutes before</span></label></li>
        <li role="option"><label role="presentation"> <span>1 hour before</span></label></li>
        <li role="option"><label role="presentation"> <span>2 hours before</span></label></li>
        <li role="option"><label role="presentation"> <span>1 day before</span></label></li>
      </ol>
    </section>
    <menu>
      <button class="affirmative full">OK</button>
    </menu>
  </form>
  </body>
</html>

Document Tags and Contributors

Tags: 
  • 2.0
  • B2G
  • building blocks
  • Firefox OS
  • Gaia
  • implementation
  • Value selector
 Contributors to this page: chrisdavidmills, chrisdavidmills-github
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:57:35 AM