donglvmang8638 2016-07-26 07:32
浏览 642

jquery - 输出显示语句

/**
* VARIABLE PRODUCT PRICING TABLE
*/
function rp_wcdpd_switch_variable_pricing_tables(element_id) {
    jQuery('.rp_wcdpd_pricing_table_variation').hide();
    jQuery(element_id).show(); 
}

if (jQuery('.rp_wcdpd_pricing_table_variation').length) {
    jQuery('input:hidden[name="variation_id"]').each(function() {
        rp_wcdpd_switch_variable_pricing_tables('#rp_wcdpd_pricing_table_variation_' + jQuery(this).val());

        jQuery(this).change(function() {
            rp_wcdpd_switch_variable_pricing_tables('#rp_wcdpd_pricing_table_variation_' + jQuery(this).val());
        });
    });
}

I have a custom piece of script that I am trying to modify. The function of this is to display a Pricing Table. One product may have hundreds of pricing tables depending on what attributes are chosen. As it stands, it will only show one at a time and only if attributes are selected.

I then modified this to allow the first pricing table to display before anything is selected. This works, but the problem is that when a user selects an attribute it shows two tables instead of the attribute table replacing the first default table.

This is what was added to show the first table as default.

jQuery('.rp_wcdpd_pricing_table_variation').first().show();

So my question is how can I write this so that the default (First table is hidden) and replaced by the attribute table?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突