我正在使用jquery mobile 1.3.0,我有以下代码用于选择菜单。当我使用data-native-menu =“false”时,选项不会显示。没有data-native-menu =“false”用户可以看到的选项。
<div data-role="fieldcontain">
<label for="virtuemart_product_id_box" class="select"> Nombre de producto:
</label>
<select id="virtuemart_product_id_box" name="virtuemart_product_id_box" data-prevent-focus-zoom="true" data-native-menu="false">
<option value="">Seleccione un producto</option>
<option value="84">Fromage Artesano Tres Leches Madurado 425 gr.</option>
<option value="85">Queso de Cabra Madurado 425 gr.</option>
<option value="83">Queso de Oveja Madurado 425 gr.</option>
<option value="86">Queso de Vaca Madurado 425 gr.</option>
<option value="87">Queso de Vaca Madurado Ahumado 425 gr.</option>
在调试时,会显示以下信息:
滚动到#virtuemart_product_id_box-listbox的-99919目标。
为什么会这样?
我在virtmart视图中使用此选择。我使用view.html.php加载选择选项
$options = array();
$options[] = JHTML::_('select.option', '', JText::_('Seleccione un producto'));
foreach($products as $product):
$options[] = JHTML::_('select.option', $product->virtuemart_product_id, $product->product_name);
endforeach;
if (isset($product_id)){
$this->lists['products']= JHTML::_('select.genericlist', $options, 'virtuemart_product_id_box', 'class="inputbox" onchange="this.form.submit();" data-prevent-focus-zoom="true" data-native-menu="false" ', 'value', 'text', $product_id);
}
else {
$this->lists['products']= JHTML::_('select.genericlist', $options, 'virtuemart_product_id_box', 'class="inputbox" onchange="this.form.submit();" data-prevent-focus-zoom="true" data-native-menu="false" ', 'value', 'text',$options[0]);
}
呈现html的default.php
<?php
defined('_JEXEC') or die('Restricted access');
JHTML::_( 'behavior.modal' );
$document = JFactory::getDocument();
?>
<form action="<?php JRoute::_('index.php'); ?>" method="post">
<h1 class="title">
<?php echo JText::_('COM_VIRTUEMART_PRODUCER') .' '.$this->mf_name ?>
</h1>
<div data-role="fieldcontain">
<label for="virtuemart_product_id_box" class="select"> <?php echo JText::_('COM_VIRTUEMART_PRODUCT_NAME') ?>:
</label>
<?php echo $this->lists['products']; ?>
</div>
</form>
我也在使用Jtouch模板进行joomla移动显示。
我在html上找到了以下脚本:
<script type="text/javascript">
var jtouchPageId = 0;
var jtouchPageTransition = 'fade';
var jtouchHeaderTheme = 'b';
var jtouchAdd2HomMessage = 'Install this web app on your %device: tap %icon and then <strong>Add to Home Screen</strong>.';
var jtouchShowAppDialog = true;
var jtouchPage = '';
</script>
<script type="text/javascript">
vmSiteurl = 'http://localhost/seleccionatu/' ;
vmLang = ""
vmCartText = 'fue agregado a su carro' ;
vmCartError = 'Hubo un error al actualizar su carro' ;
loadingImage = '/seleccionatu/components/com_virtuemart/assets/images/facebox/loading.gif' ;
closeImage = '/seleccionatu/components/com_virtuemart/assets/images/facebox/closelabel.png' ;
Virtuemart.addtocart_popup = '1' ;
faceboxHtml = '<div id="facebox" style="display:none;"><div class="popup"><div class="content"></div> <a href="#" class="close"></a></div></div>'
window.addEvent('domready', function() {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
这些脚本是否会导致select的弹出窗口无法打开?另请注意,该网址已添加#goodmart_product_id_box-listbox