jquery - 移动设备上的 Wordpress 问题选择选项行克隆
问题描述
我在 WordPress 管理区域的插件有问题。我有一个表格,您可以在其中选择一项服务,然后输入该服务的链接。要添加另一个服务,您必须单击一个按钮,并且该表实际上是克隆的。在桌面(也是响应式)上运行没有问题,但在移动设备上,您无法选择服务或输入链接。是 jQuery 脚本吗?
<div class="wrap">
<input type="hidden" name="metabox_noncename" id="metabox_noncename" value="<?php wp_create_nonce( plugin_basename(__FILE__) ) ?>" />
<div id="meta_inner">
<p>Hier hast du die Möglichkeit deine Linkliste zu erstellen.</p>
<span class="add button-primary alignright"><?php _e('Add Link'); ?></span>
<table class="form-table striped sortable">
<col width="15%"/>
<col/>
<col width="8%"/>
<col width="10%"/>
<thead>
<tr>
<th><?php _e('1. Service wählen') ?></th>
<th><?php _e('2. Link / Song o. Profil auf Plattform') ?></th>
<th><?php _e('3. Speichern oder nächsten Link hinzufügen') ?></th>
</tr>
</thead>
<tbody id="template" style="">
<?php $serviceCount = "REPLACETHISID"; include $template_path.'metabox_row.php'; ?>
</tbody>
<tbody id="here">
<?php
$serviceCount = 0;
foreach($app_links as $service_id => $value) {
$validation = $this->services[$service_id]['validation'];
$validation_error = $this->services[$service_id]['validation-error'];
include $template_path.'metabox_row.php';
$serviceCount++;
}
?>
</tbody>
<tfoot>
</tfoot>
</table>
<script>
jQuery(document).ready(function() {
jQuery(".add").click(function() {
template = jQuery("#template tr")[0].cloneNode(true)
elements = jQuery('.master_link_row').length
template.innerHTML = template.innerHTML.replace(/REPLACETHISID/g,elements);
jQuery('#here').prepend(template);
return false;
});
jQuery("#here").on('click', ".master_link_row .remove", function() {
jQuery(this).parent().parent().remove();
});
});
</script>
</div>
</div>
解决方案
推荐阅读
- mysql - 使用一个接一个的值进行查询,为一堆值工作
- sql - 将每行中的值与列的平均值进行比较 (SQL)
- javascript - 从 QRCode 扫描时在输入值中添加逗号
- mysql - JPA - 使用特殊章程运行“插入”的 sql NativeQuery 失败
- c# - c# MySQL Connect I gоt a System.NullReferenceException Object reference not set an instance of an object
- mysql - 使用 WHERE 子句加入多个表,包括没有公共 ID 的行
- c# - 如何读取 Windows.Devices 命名空间中的 DeviceInformation 属性
- c# - 没有无参数构造函数的自引用类层次结构的序列化/反序列化
- github - 为什么我不能从 GitHub 克隆存储库
- java - ASS/SSA 字幕样式渲染