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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:48:42+00:00 2026-05-27T22:48:42+00:00

I have a custom select menu (multiple) defined as follows: <select name=DanceStyles id=DanceStyles multiple=multiple

  • 0

I have a custom select menu (multiple) defined as follows:

 <select name="DanceStyles" id="DanceStyles" multiple="multiple" data-native-menu="false">

Everything works fine except that I want to move the header’s button icon over to the right AND display the Close text. (I have found some mobile users have a problem either realising what the X icon is for or they have trouble clicking it, so I want it on the right with the word ‘Close’ making too big to miss.) There don’t seem to be any options for doing that on the select since its options apply to the select bar itself.

I have tried intercepting the create event and in there, finding the button anchor and adding a create handler for that, doing something like this (I have tried several variations, as you can see by the commenting out):

        $('#search').live('pagecreate', function (event) {
           $("#DanceStyles").selectmenu({
            create: function (event, ui) {
               $('ul#DanceStyles-menu').prev().find('a.ui-btn').button({
                    create: function (event, ui) {
                        var $btn = $(this);
                        $btn.attr('class', $btn.attr('class').replace('ui-btn-left', 'ui-btn-right'));
                        $btn.attr('class', $btn.attr('class').replace('ui-btn-icon-notext', 'ui-btn-icon-left'));
   //                             $(this).button({ iconpos: 'right' });
   //                            $btn.attr('class', $btn.attr('class').replace('ui-btn-icon-notext', 'ui-btn-icon-left'));
       //                            //                            $btn.attr('data-iconpos', 'left');
                        $(this).button('refresh');
                    }
                });
            }
        });
    });

So I have tried resetting the button options and calling refresh (didn’t work), and changing the CSS. Neither worked and I got weird formatting issues with the close icon having a line break.

Anyone know the right way to do this?

  • 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-27T22:48:43+00:00Added an answer on May 27, 2026 at 10:48 pm

    I got this to work cleanly after looking at the source code for the selectmenu plugin. It is not in fact using a button; the anchor tag is the source for the buttonMarkup plugin, which has already been created (natch) before the Create event fires.

    This means that the markup has already been created. My first attempt (see my question) where I try to mangle the existing markup is too messy. It is cleaner and more reliable to remove the buttonMarkup and recreate it with my desired options. Note that the ‘#search’ selector is the id of the JQ page-div, and ‘#DanceStyles’ is the id of my native select element. I could see the latter being used for the id of the menu, which is why I select it first and navigate back up and down to the anchor; I couldn’t see any other reliable way to get to the anchor.

    $('#search').live('pagecreate', function (event) {
        $("#DanceStyles").selectmenu({
            create: function (event, ui) {
                $('ul#DanceStyles-menu').prev().find('a.ui-btn')
                    .empty()
                    .text('Done')
                    .attr('class', 'ui-btn-right')
                    .attr("data-" + $.mobile.ns + "iconpos", '')
                    .attr("data-" + $.mobile.ns + "icon", '')
                    .attr("title", 'Done')
                    .buttonMarkup({ iconpos: 'left', icon: 'arrow-l' });
            }
        });
    });
    

    The buttonMarkup plugin uses the A element’s text and class values when creating itself but the other data- attributes result from the previous buttonMarkup and have to be removed, as does the inner html that the buttonMarkup creates (child span, etc). The title attribute was not recreated, for some reason, so I set it myself.

    PS If anyone knows of a better way to achieve this (buttonMarkup(‘remove’)? for example), please let us know.

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

Sidebar

Related Questions

I have a custom spinner (customized for formatting). It works fine and shows the
In my django admin.py I have a custom widget based on a select menu.
I currently have a web site where users can select a custom theme. After
I am trying to add my own custom select menu to the new CKEditor.
I have a custom field name front_sl_slider. I want to display all the posts
I'm using a jquery mobile custom select menu for a selection of countries. I
I have created a custom date_Select field using 3 separate select fields: <%= f.select
Possible Duplicate: How to make a custom select option menu style without image in
I have a custom made ASP control which is based on a select (drop
I have created a UIMenuController and have set it a custom menu item like

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.