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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:17:45+00:00 2026-06-08T05:17:45+00:00

This is my first time with jQuery Mobile and I’m actually using it from

  • 0

This is my first time with jQuery Mobile and I’m actually using it from a WP theme I got. I understand that this might be theme related but I just want to make sure.

So, it is a WordPress jQuery Mobile theme, you plug it and it works a treat. The thing is, I’ve converted the WordPress menu from an UL to a SELECT.

I have then added some jQuery to fire the select on change by getting the value of the selected option. That works, I get the loading thinggy and then the page changes with my desired effect.

But I can’t get the Select menu to show the current selected item. It always reverts to the first one.

I have used:

$('#main_menu').selectmenu("refresh");
$('#main_menu').selectmenu("refresh", true);

But nothing…

You can have a look at the site here: http://avatarblog.fl1hosting.com/ and look at the source.

You will see that my mobile event are all before the jQuery Mobile include, which doesn’t make much sense to me, but if I put them afterwards, nothing works.

Any help would be highly appreciated!

Thanks

  • 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-08T05:17:47+00:00Added an answer on June 8, 2026 at 5:17 am

    You need to set which option to show in the select menu. Try this,

    $("#main_menu")[0].selectedIndex = 2; // this will select the 3rd in the menu list
    $("#main_menu").selectmenu("refresh");
    

    You can add the following script your header.php:

    $(document)
    .unbind("pageshow.initMenuBtn")
    .bind("pageshow.initMenuBtn", 
        function() {
            $.mobile.activePage = $("div.ui-page-active");
            $("#main_menu", $.mobile.activePage)
              .unbind("change")
              .bind("change", function() {
                    var page = $(this).val();
                    $.mobile.changePage(page);
                });
    
            var selectedIndex = 0;
            $("#main_menu>option", $.mobile.activePage).each(function(index) {
                if ($(this).hasClass("current-menu-item")) {
                    selectedIndex = index;
                }
            });
            $("#main_menu", $.mobile.activePage)[0].selectedIndex = selectedIndex;
            $("#main_menu", $.mobile.activePage).selectmenu("refresh");
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time using jQuery and I am pleased to get my
This is my first time using lightbox which uses jquery framework. But when I
This is my first time working with a WPF datagrid. From what I understand
This is my first time using JQuery in any of my projects. I have
this is my first time using jquery, and i dont think it seems to
First time using jQuery parent and got confused, here's my html: <div id=friends_inveni class=friends_rec
This is my first time attempting to call an ASP.NET page method from jQuery.
I'm making a dynamic select menu using Jquery mobile. First problem that i am
This is my first time using jquery, and I don't know why this simple
I am using jQuery Mobile for the first time. I have the following code:

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.