The Wayback Machine - https://web.archive.org/web/20240709132117/https://www.geeksforgeeks.org/jquery-mobile-listview-counttheme-option/
Open In App

jQuery Mobile Listview countTheme Option

Last Updated : 07 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

jQuery Mobile is an HTML5 based user interface system designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive listview used to view the unordered lists.

In this article, we will use the jQuery Mobile Listview countTheme option. The countTheme option sets the theme color of the count bubbles in the list item. The count bubbles are elements usually aligned at the right end of listview items. 

Note: To create a count bubble, wrap a number in class “ul-li-count”.

Syntax: Use the following syntax to change the theme of count bubbles using the countTheme option. It takes a single character from a-z where each character represents a color.

For initialization for the first time, use the following syntax.

$(".items").listview({
    countTheme:"b",
});
  • Get countTheme option.

    var countThemeOption = 
        $(".items").listview( "option", "countTheme" );
  • Set countTheme option.

    $(".items").listview( "option", "countTheme", "b" );

CDN Links: Use the following CDN links for your jQuery Mobile project.

<link rel=”stylesheet” href=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”https://code.jquery.com/jquery-1.11.1.min.js”></script>
<script src=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>

Example: We have set to the dark theme of countTheme by using the character “b”.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" 
          href=
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
    <h3>jQuery Mobile Listview countTheme Option</h3>
    <ul class="items">
        <li>
            <a href=
               target="_blank">
                Data Structures
                <span class="ui-li-count">67</span>
            </a>
        </li>
        <li>
          <a href=
                target="_blank">
                Interview preparation
                <span class="ui-li-count">22</span>
            </a>
        </li>
        <li>
            <a href=
                Java Programming
                <span class="ui-li-count">102</span>
            </a>
        </li>
    </ul>
    <script>
        $(".items").listview({
            countTheme: "b",
        });
    </script>
</body>
  
</html>


Output:

jQuery Mobile Listview countTheme Option

Reference: https://api.jquerymobile.com/listview/#option-countTheme



Previous Article
Next Article

Similar Reads

jQuery Mobile Listview classes Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview classes option to add additional classes to the widget's elements. Syntax: Initializing the Listview with the classes option. $( ".selector" ).listview({
2 min read
jQuery Mobile Listview dividerTheme Option
jQuery Mobile is an HTML5 based user interface system designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive listview used to view the unordered lists. In this article, we are going to implement the di
2 min read
jQuery Mobile Listview defaults Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview defaults option. When the value of this option is set to "true" that means other widgets options have default values and causes jQuery Mobile's widget au
2 min read
jQuery Mobile Listview autodividers Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview autodividers option. This option is given by the "listview.autodividers" extension and when the value of this option is set to "true", then dividers are
2 min read
jQuery Mobile Listview autodividersSelector Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview autodividersSelector option. This option is given by the “listview.autodividers" extension and the value of this option is a function that returns a stri
2 min read
jQuery Mobile Listview filterCallback Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview filterCallback option. This option is of a function type that is used to determine which rows to hide when the search filter textbox changes. Note: This
2 min read
jQuery Mobile Listview initSelector Option
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Listview initSelector option. The value of this option is a selector string that picks elements on the basis of the value of this option and explicates the stated
2 min read
jQuery Mobile Listview theme Option
jQuery Mobile is a set of HTML5 based user system interaction widget toolbox used for various purposes build on top of jQuery. It is designed to build fast and responsive sites accessible to mobile, tabs, and desktops. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive Listview used to view the unordered lists
2 min read
jQuery Mobile Listview icon Option
jQuery Mobile is a set of HTML5 based user system interaction widget toolbox used for various purposes build on top of jQuery. It is designed to build fast and responsive sites accessible to mobile, tabs, and desktops. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive Listview used to view the unordered lists
2 min read
jQuery Mobile Listview filter Option
jQuery Mobile is a set of HTML5 based user interaction widget toolbox used for various purposes build on top of jQuery. It is designed to build fast and responsive websites accessible to mobile, tabs, and desktops. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive Listview used to view the unordered lists. In
2 min read
three90RightbarBannerImg