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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:41:20+00:00 2026-06-05T01:41:20+00:00

I’m starting with jQuery mobile and have some problems with my buttons. The web

  • 0

I’m starting with jQuery mobile and have some problems with my buttons.

The web application is a shopping list. It displays a list of items to shop and in the footer buttons on actions I can perform on the items.

The actions are:

  1. increment number of items to buy
  2. decrements number of items to buy
  3. move item up in list
  4. move item down in list
  5. add new item
  6. delete item
  7. modify item text description

The actions are implemented in javascript and works fine. The problems I have is with controlling the buttons and the associated actions.

By experience, I have see that for the increment and decrement it is more convenient to have a button with an active state, for the other operations it is preferable to have a selected item and apply the action on the selected item when the button is pressed. When adding an item, the item would be inserted before the selected item, and if pressed when no item is selected, the new item is appended to the list.

I would also like to have 2 modes. In one mode, only the increment and decrement buttons are shown and the user can update the number of items in its list. In the other mode the user is modifying its list. It is in the second mode that the selected item is required.

I managed to associate a default action my item lists by using the .on() method as a delegate.

$('#itemList').on( "click", ".item", function(evt)
    { ctrl.doAction($(evt.currentTarget)); });

Here is the html code I use to test the first mode.

<!-- footer -->
<div data-role="footer" data-position="fixed" class="ui-bar" id="btnBar" >
    <a href="" data-role="button" data-icon="plus" id="btnPlus"> Plus </a>
    <a href="" data-role="button" data-icon="minus" id="btnMinus"> Minus </a>
</div>
<!-- /footer -->

What should I put as href value ? I don’t want the page to be reloaded. In some examples I see “#”.

This is how I associate the action to the button:

$('#btnPlus').on( "tap", function(evt) 
    { ctrl.doAction = ctrl.increment; });

Another problem I have is that there is no feedback on the button click action. When I click a button I would expect to have it highlighted for a short time. This doesn’t happen.

The browsers have also different behaviors. In firefox, the clicked button gets a blue halo apparently showing that it has the focus. But the button isn’t displayed as active.

If I put “#!” as href (don’t know what it means) on Android, the clicked button is shown active.

Should I use click or tap as event type ? How could I write click or tap ?

How could I implement a two state button displayed as active and inactive ?
How is an action button used : always displayed inactive and feedback when pressed ?

  • 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-05T01:41:21+00:00Added an answer on June 5, 2026 at 1:41 am

    I solved the problem my self.

    1. to switch between sets of buttons in the footer, I create multiple footers in my HTML document with style=”display:none” in the hidden footers. The one without this will be shown. I assigned a specific id to each footer so that I can write $(“#footer1”).hide(); $(“#footer2”).show();

    2. I have buttons to switch between footers. The footer switching event handler must be called with the “mouseup” event. This is required for it to work on the iPad and Android phones.

    3. To change appearance, don’t use .button() as suggested here. Use:

      $(“#myButton”)
      .removeClass( “ui-btn-up-a ui-btn-down-a ui-btn-hover-a” )
      .addClass(“ui-btn-up-b”)
      .attr( “data-theme”, “b” );

    Note: There was a bug in my code which caused desperate hair pulling

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.