我已阅读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。由于某种原因,它不会改变班级。
关于什么可能出错的任何想法?
答案 0 :(得分:0)
我设法通过改变我的jquery来解决这个问题:
jQuery(document).ready(function () {
jQuery(".info").hover(
function () {
jQuery(".info").toggleClass('showinfo');
}})