【问题标题】:woocommerce customising checkout fieldswoocommerce 自定义结帐字段
【发布时间】:2023-04-10 04:19:01
【问题描述】:

我已经阅读了 woocommerce 关于如何自定义结帐字段的文档:

http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

我有以下工作正常:

$fields['order']['billing_last_name']['label_class'] = array('info');
 return $fields;

这会为 billing_last_name 字段的标签添加一个新类。

我想在上面添加一个 on:hover 事件,因此当您将鼠标悬停在“info”类上时,它会变为“showinfo”。这背后的想法是我想创建一个工具提示。

我已添加以下 jQuery 来执行此操作:

$(document).ready(function () {
$(".info").hover(
function () {
$(".info").toggleClass('showinfo');
}});

我也加入了 jQuery。由于某种原因,它不会改变类。

对可能出现的问题有任何想法吗?

【问题讨论】:

    标签: jquery wordpress woocommerce


    【解决方案1】:

    我设法通过更改我的 jquery 来解决这个问题:

    jQuery(document).ready(function () {
    jQuery(".info").hover(
    function () {
    jQuery(".info").toggleClass('showinfo');
    }})
    

    【讨论】:

      猜你喜欢
      • 2017-03-21
      • 2013-07-07
      • 2015-12-16
      • 1970-01-01
      • 2015-04-20
      • 2021-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多