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 7672199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:13:52+00:00 2026-05-31T16:13:52+00:00

I have the following HTML on a Jquery Mobile Page: <div data-role=controlgroup data-type=horizontal class=panelSwitcher>

  • 0

I have the following HTML on a Jquery Mobile Page:

<div data-role="controlgroup" data-type="horizontal" class="panelSwitcher">
    <input type="button" data-theme="a" data-iconpos="notext" data-icon="gallery" value="Galley" class="viewGrid" />
    <input type="button" data-theme="a" data-iconpos="notext" data-icon="panels"  value="Panels" class="viewPanel" />
    <input type="button" data-theme="a" data-iconpos="notext" data-icon="detail" value="Detail" class="viewDetail"  />
</div>

This renders correctly. However, since I’m starting out in Gallery view, I would like the first button to have active state, when the page loads.

Question:
Is this possible in plain markup (no Jquery/Javascript). I tried a couple of things, like selected=”selected” and adding ui-btn-active, but none of them seem to work.

Thanks for some pointers!

  • 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-05-31T16:13:53+00:00Added an answer on May 31, 2026 at 4:13 pm

    If you make your buttons out of links then you can add the .ui-btn-active class to the links to give it the active state by default:

        <div data-role="controlgroup" data-type="horizontal" class="panelSwitcher">
            <a class="viewGrid ui-btn-active" data-role="button" data-theme="a" data-icon="gallery" data-iconpos="notext">Gallery</a>
            <a class="viewPanel" data-role="button" data-theme="a" data-icon="panels" data-iconpos="notext">Panels</a>
            <a class="viewDetail" data-role="button" data-theme="a" data-icon="detail" data-iconpos="notext">Detail</a>
        </div>
    

    Here is a demo: http://jsfiddle.net/hJsJc/

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

Sidebar

Related Questions

I have a login page using jQuery Mobile which contains the following code: <div
I have following HTML <div id=finalTree> <ul> <li class=last style=display: list-item;> <a id=DataSheets href=#>Data
I have the following html in page: <head> <script src=jquery-1.3.2.min.js type=text/javascript></script> <script> function hideIt()
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a
I have the following html in my site: <link type=text/css href=/Styles/ui-lightness/jquery-ui-1.8.2.custom.css rel=Stylesheet /> <link
I have the following jQuery Mobile HTML code, the navbar's content is set using
I have the following html + jquery: <body> <head> <script type=text/javascript src=jquery.js></script> <script> $(window).load(function()
I have the following html (i'm also using Jquery and JqueryUI) <div style=display:none; position:fixed;
I have the following HTML <form id=create_form name=create_form action= method=post> <input name=type id=type value=individuel
I have the following HTML and jQuery code: <div id=outer> <p> <p>paragraph inside division.</p>

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.