Reputation: 549
See this select
element with display:none
. In jQuery Mobile it is displayed despite this:
<select id="dddd" name="dddd"
data-mini="true" data-native-menu="false" data-theme="c"
onChange=""
style="display:none">
<option value="1">An optinos</option>
</select>
I'm trying to show/hide jQuery Mobile select
elements dependent on other user actions hence why I'm doing the above.
Any ideas?
Upvotes: 8
Views: 10860
Reputation: 1561
When your page loads, jQuery Mobile enhances your page to have it the mobile look-and-feel. Unfortunately, there is currently an issue with jQuery mobile that it cannot attach custom classes (and even custom styles, by the style attribute) to enhanced elements. Please check https://github.com/jquery/jquery-mobile/issues/3577 for the issue. As a workaround while this issue is still not resolved, you may actually wrap it inside a div element and control the display of the div wrapper instead.
<div id="dddd-wrapper" class="ui-screen-hidden">
<select data-mini="true" data-native-menu="false" id="dddd" name="dddd" data-theme="c" onChange="" style="display:none">
<option value="1">An optinos</option>
</select>
</div>
ui-screen-hidden
is a jquery mobile defined style rule (in jquery.mobile..css) for hiding an element.
Upvotes: 12