Jquery mobile select menu overlays on extreme right - jquery-mobile

I am using jquery mobile select menu with data-native-menu as false. The issue is if i click select menu, overlay popups on extreme right, instead of above the select menu control. i fixed my page max-width as 400px. Jquery mobile calculating the overlay position based on screen size,hence if i reduced the screen size overlay popup above the select menu control. But how can i make the select menu to overlay within my page size in maximized mode of screen?
<div style="margin:0 auto;">
<div data-role="page" style="width:400px">
<div data-role="fieldcontain">
<label for="select-choice-9" class="select">Shipping method(s):</label>
<select name="select-choice-9" id="select-choice-9" multiple="multiple" data-native-menu="false">
<option>Choose options</option>
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
</div>
</div>
Here is the picture. The gray area is the page size (data-role=page). Since I have a bigger monitor, the menu appears on the extreme right.

Set the width on the fieldContain div instead of the parent div
<div data-role="page">
<div data-role="fieldcontain" style="width:400px">
<label for="select-choice-9" class="select">Shipping method(s):</label>
<select name="select-choice-9" id="select-choice-9" multiple="multiple" data-native-menu="false">
<option>Choose options</option>
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
</div>

Related

how to change background color of input group items when they hover in bootstrap 5

I have a select element with some option items and I want to change the blue background color of items (option) when they hover.
here is the bootstrap 5 code:
<div class="input-group">
<select class="form-select" id="inputGroupSelect04" aria-label="Example select with button addon">
<option selected>Choose Your operating System</option>
<option value="1">Windows</option>
<option value="2">Mac</option>
<option value="3">Linux</option>
</select>
<button class="btn download-btn" type="button">Download</button>
</div>

jQuery Mobile- data-theme="d" is not working

I want to use data-theme d in my select. How ever jQuery Mobile ignores the data-theme="d"and display it as theme a.
<div id="mutualFriends">
<select class="sortBy" name="sortBy" data-url="${url}" data-theme="d">
<option value="">Sort By</option>
<option value="new" selected="selected">Newest</option>
<option value="old">Oldest</option>
<option value="firstName_asc">First Name a-z</option>
</select>

jquery mobile data-native-menu with data-history attribute

<div data-role="fieldcontain">
<select data-mini="true" data-inline="false" data-history="false" data-native-menu="false" data-theme="d" data-overlay-theme="b" name="elArr[]">
<option value="" data-placeholder="true">test</option>
<option value="1">1</option>
</select>
</div>
Hi, I like use data-native-menu with data-histroy attribute same time. data-history property doesn't work. When opened native menu, it add hash ui-state=dialog to location bar.

jQuery Mobile 1.1.1 Custom Select Menu - Placeholder Text not Visible

After upgrading to jQuery Mobile 1.1.1 earlier today (7/13/2012) I noticed that all of my Custom Select menus no longer show the placeholder text on page load. Is there something I need to do differently in 1.1.1 to show the placeholder text in custom select menus? Help!?!?
Here's a sample of my code:
<div data-role="fieldcontain" class="ui-hide-label no-field-separator">
<label for="ceiling" class="select" data-theme="a">Ceiling</label>
<select name="ceiling" id="ceiling" data-theme="a" data-native-menu="false" class="required">
<option data-placeholder="true">Ceiling (Yes/No)</option>
<option value="Yes">Ceiling: Yes</option>
<option value="No">Ceiling: No</option>
</select>
</div>
Sample image (the black bars are my custom select menus):
this code is working for me :
<select>
<option value="" data-placeholder="true">Choose one:</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
Just put value="" on your placeholder option

Hide Select Menu icon in jQuery Mobile

Is it possible to hide the default icon used for select menus within jQuery Mobile? By default they use the down arrow icon. I know it's possible to specify an icon via the data-icon attribute, but I haven't found a way to hide it.
Example that's using the default icon:
<div data-role="fieldcontain">
<label for="select-choice-1" class="select">Choose shipping method:</label>
<select name="select-choice-1" id="select-choice-1">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
You can use data-iconpos="noicon" like so:
<div data-role="fieldcontain">
<label for="select-choice-1" class="select">Choose shipping method:</label>
<select name="select-choice-1" id="select-choice-1" data-iconpos="noicon">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
Any value for the data-iconpos attribute other than: top, right, bottom, or left will not display an icon.
Here is a link to a jsfiddle of this example: http://jsfiddle.net/KWQJf/
For one reason or another on SELECT boxes, the div still remained even though I set data-iconpos='noicon'... SO what I did was a littly hackish, but not bad. I called this Jquery function onload (IN ADDITION to data-iconpos='noicon')
$('.ui-icon.ui-icon-arrow-d.ui-icon-shadow').remove();
Hope this helps anyone who experienced the same problem I did. :)
You can override that style in your own stylesheet:
.ui-select .ui-icon-arrow-d {
display: none;
}

Resources