我正在尝试将 Woocommerce 商店中的产品页面选项卡转换为手风琴式,但无法正常工作。当我点击链接时,下拉菜单不显示,它什么也不做...高度应该像我的“+”图标一样动画,但什么也没有发生。看起来它不需要在单击的元素上添加“is-open”类。所以我认为我的错误在于我的js,但我不知道在哪里!这是我的 tabs.php 文件:<?php/** * Single Product tabs * * This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 3.8.0 */if (!defined('ABSPATH')) { exit;}/** * Filter tabs and allow third parties to add their own. * * Each tab is an array containing title, callback and priority. * * @see woocommerce_default_product_tabs() */$product_tabs = apply_filters('woocommerce_product_tabs', array());if (!empty($product_tabs)) : ?> <div class="c-accordion"> <div class="c-accordion__wrapper"> <div class="c-accordion__content-wrapper"> <?php foreach ($product_tabs as $key => $product_tab) : ?> <div class="c-accordion__content js-accordion"> <div class="c-accordion__content-title"> <span class="c-accordion__plus"></span> <p class="u-a1"> <?php echo wp_kses_post(apply_filters('woocommerce_product_' . $key . '_tab_title', $product_tab['title'], $key)); ?> </p> </div> <div class="c-accordion__content-main js-content">
添加回答
举报
0/150
提交
取消