Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:54:14+00:00 2026-06-10T10:54:14+00:00

I have a controlgroup and I am dynamically adding and removing ui-btn-active class to

  • 0

I have a controlgroup and I am dynamically adding and removing ui-btn-active class to toggle the active button. The button toggles just fine, but I can’t seem to find a way to change the active button theme.

I want the in-active buttons to use the d theme and the active
buttons to use the a theme.

Does anyone know how I can do this?

enter image description here

HTML:

<div data-role="controlgroup" data-type="horizontal">
    <a href="#" data-role="button" data-inline="true" data-mini="true" id="myApptBtn">My Appointments</a>
    <a href="#" data-role="button" data-inline="true" data-mini="true" id="allApptBtn">All Appointments</a>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:54:15+00:00Added an answer on June 10, 2026 at 10:54 am

    OK so this is what I ended up doing.

    jQuery:

    $('[data-role="page"]').live('pageshow', function () {
        $('#myApptBtn').addClass('ui-btn-active');
    
        $('#myApptBtn').click(function () {
            $('#allApptBtn').removeClass('ui-btn-active');
            $('#myApptBtn').addClass('ui-btn-active');
        });
    
        $('#allApptBtn').click(function () {
            $('#myApptBtn').removeClass('ui-btn-active');
            $('#allApptBtn').addClass('ui-btn-active');
        });
    });
    

    HTML:

    <li data-theme="d" class="li-state-small" style="text-align: center;">
        <div data-role="controlgroup" data-type="horizontal" class="btnFontSize12">
            <a href="#" data-role="button" data-inline="true" data-mini="true" id="myApptBtn">My Appointments</a>
            <a href="#" data-role="button" data-inline="true" data-mini="true" id="allApptBtn">All Appointments</a>
        </div>
    </li>
    

    Answer to Question:

    So as it turns out, you can’t override the theme via the markup.

    Global “Active” state

    The jQuery Mobile framework uses a swatch called “active” (bright blue
    in the default theme) to consistently indicate the selected state,
    regardless of the individual swatch of the given widget. We apply this
    in navigation and form controls whenever there is a need to indicate
    what is currently selected. Because this theme swatch is designed for
    clear, consistent user feedback, it cannot be overridden via the
    markup; it is set once in the theme and applied by the framework
    whenever a selected or active state is needed. The styling for this
    state is in the theme stylesheet under the ui-btn-active style rules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: <div data-role=header > <div data-role=controlgroup data-type=horizontal > <div id=b1 data-role=button >b1</div>
I have a set of radio button groups. How can I get which is
I have a Jquery Mobile controlgroup with two buttons: <div data-role=controlgroup data-type=horizontal class=headerMenu iconposSwitcher>
So I have a Radio button group, like so: <div data-role=fieldcontain> <fieldset data-role=controlgroup> <legend>Choose
I have a group of buttons, which I'm adding buttons to dynamically. My selection
I have an empty controlgroup, which I want to populate with buttons. Can't get
have written this little class, which generates a UUID every time an object of
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.