jQuery实现产品对比功能附源码下载(2)

$(document).on('click', '.modal-closebtn', function () { $(".contentPop").empty(); $(".comparePan").empty(); $(".comparePanle").hide(); $(".modPos").hide(); $(".selectProduct").removeClass("selected"); $(".cmprBtn").attr('disabled', ''); list.length = 0; $(".rotateBtn").toggleClass("rotateBtn"); });

最后,我们在比对框中也可以移除比对的产品,点击比对产品框中的“x“号,会移除对应的产品。

$(document).on('click', '.selectedItemCloseBtn', function () { var test = $(this).siblings("p").attr('id'); $('[data-title=' + test + ']').find(".addToCompare").click(); hideComparePanel(); }); function hideComparePanel() { if (!list.length) { $(".comparePan").empty(); $(".comparePanle").hide(); } }

以上所述是小编给大家介绍的jQuery实现产品对比功能附源码下载,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzxgjy.html