Lists with Icons

Description

We can also use smaller icons instead of thumbnails. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element.

Example


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<style>
.ui-li-heading {<!--from w ww  . j  av  a 2s  .  c o  m-->
  overflow: visible;
}
.ui-li-thumb {
  top: 1em;
}
.ui-li-rating {
  font-size: 32px;
}
</style>
<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" data-theme="b">
    <div data-role="header">
      <h1>Reviews</h1>
      <a href="#" data-icon="plus" data-iconpos="notext"
        class="ui-btn-right"></a>
    </div>
    <div data-role="content">
      <ul data-role="listview" data-inset="true" data-theme="e">
        <li data-role="list-divider">Average Review</li>
        <li><img src="http://placehold.it/30x30">
          <h3>X-Men</h3>
          <p>
            <span class="ui-li-rating">90%</span><strong> liked it!</strong>
          </p>
          <p>
            User Ratings: <em>2,222</em>
          </p></li>
      </ul>

      <ul data-role="listview" data-inset="true" data-theme="d">
        <li data-role="list-divider">User Reviews</li>
        <li><a href="#"> <img src="http://placehold.it/30x30"
            class="ui-li-icon">
            <p>
              <strong>Go See It!</strong>
            </p>
            <p>This is a test.</p>
        </a></li>
        <li><a href="#"> <img src="http://placehold.it/30x30"
            class="ui-li-icon">
            <p>
              <strong>Go See It!</strong>
            </p>
            <p>Best movie.</p>
        </a></li>
        <li><a href="#"> <img src="http://placehold.it/30x30"
            class="ui-li-icon">
            <p>
              <strong>Go See It!</strong>
            </p>
            <p>CSS3 gradients.</p>
        </a></li>
        <li>
          <p>
            <a href="#">Show More Reviews...</a>
          </p>
          <p>This is a test.</p>
        </li>
      </ul>
    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme