首页 > 解决方案 > 移动设备上的 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>

标签: jquerywordpressmobilecloneoption

解决方案


推荐阅读