简体   繁体   English

用YITH ajax导航过滤后,我的jquery代码不起作用

[英]After filter with YITH ajax navigation my jquery codes not working

I ain't to use yith ajax navigation in my theme 我不会在主题中使用ith ajax导航

When I use it every things are perfect but when click a element to filter, after that my jquery codes stop working. 当我使用它时,一切都很完美,但是当单击一个元素进行过滤时,此后我的jquery代码停止工作。

In yith site they say: 在ith网站上,他们说:

If your product list contains some JavaScript code, once the ajax filters are selected they cannot longer work. 如果您的产品列表包含一些JavaScript代码,则一旦选择了ajax过滤器,它们将不再起作用。 In order to fix this issue we have included two triggers you can include in your code: 为了解决此问题,我们包含了两个触发器,您可以在代码中包含它们:

//trigger ready event
$(document).trigger("ready");
$(document).trigger("yith-wcan-ajax-filtered");

http://yithemes.com/docs-plugins/yith_ajax_navigation http://yithemes.com/docs-plugins/yith_ajax_navigation

But where i should use this triggers? 但是我应该在哪里使用此触发器? I wrote them in firs of my jquery code but it doesn't work 我在我的jquery代码中写了它们,但没有用

that is easy! 那很简单! just insert that piece of jquery code in your theme: 只需在您的主题中插入那段jquery代码即可:

$(document).on("yith-wcan-ajax-filtered",function(){
    // your custom js code here
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM