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

  • Home
  • SEARCH
  • 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 7577239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:08:01+00:00 2026-05-30T17:08:01+00:00

I have used Android phonegap application for creating dynamic list with label and corresponding

  • 0

I have used Android phonegap application for creating dynamic list with label and corresponding values for that label one by one (e.g. label: ‘A’, values: Arun, Amala, Aruna up to ‘Z’) and there are alphabets in side of the page.

Now I want that when I am clicking alphabet (‘A’) the list automatically show the label (‘A’) with values, if it is ‘B’ show that label (‘B’) with values without modifying the list.

While I am clicking ‘A’, how to get current position of label (‘A’) and move the cursor to that postion show the label (‘A’) with values?

My code: I have retrive value from local database,below code is for dynamic list Script:

function querySuccess(tx,results)
{


 $('.sidemenu').append("<label style='background-color:#C1CDD9'   align='left'>"+results.rows.item(i).alphabet + "</label>"+"<br/>");
for (i = 0; i < results.rows.length; i++) 
                {

 $(".sidemenu").append("<li  id='list' >"+"<a id='link'  href='#'>" +results.rows.item(i).name +  "</a>"+ "<br/>"+ "</li>");
 }

html

<ul class="sidemenu" ></ul>

My dynamiclist like:

label-A

Arun
Aruna
Amala
label-B
Bala
bhuvana

  • 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-30T17:08:03+00:00Added an answer on May 30, 2026 at 5:08 pm

    For this, you need to use the scrollTop Method

    First, we declare a variable for the container of the items we need to scroll through.

    var container = $('.sidemenu'); // this is our div
    

    Then our click function

    $("#A").click(function(){
      scrollTo = $(this); // wherever our element with an Id of "A" is;
    
      //the magic
      container.scrollTop( scrollTo.offset().top - container.offset().top + container.scrollTop() );
    });
    

    This should scroll directly to the item within your .sidemenu list.

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

Sidebar

Related Questions

I have used PreferenceActivity to have preference in my android application. I want one
i have used eclipse, android sdk and phonegap to create a small application. I
I have used an Android application recently that has an interesting UI pattern in
I have used facebook application for one of my android application. But i need
i have uploaded an application in android market that was displayed in my android
I am integrating my Android app with facebook for that I have used Facebook
In my android application i have used the google map. I have using android
I have developed an application on android.I have used Map overlay class in application.When
Long back, android used to have GtalkService that let applications use Gtalk for various
I am developing a twitter client for android. I have used twitter4J for that.

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.