最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Algolia instantsearch.js callback function - Stack Overflow

programmeradmin2浏览0评论

I am using Algolia instantsearch.js as my site search.

The setup process was rather easy and straightforward, including .js and .css files, creating templates and then create one more .js file with app() function for setting up my app (appId, apiKey, indexName) and widgets.

What I need is a function that will execute each time a search function ran, preferably right after the hits are shown.

Maybe there is a widget for that?

Thanks!

I am using Algolia instantsearch.js as my site search.

The setup process was rather easy and straightforward, including .js and .css files, creating templates and then create one more .js file with app() function for setting up my app (appId, apiKey, indexName) and widgets.

What I need is a function that will execute each time a search function ran, preferably right after the hits are shown.

Maybe there is a widget for that?

Thanks!

Share edited Jun 13, 2017 at 21:19 bobylito 3,39226 silver badges28 bronze badges asked Apr 15, 2016 at 7:18 Silver RingveeSilver Ringvee 5,5456 gold badges33 silver badges48 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

You can listen the render event like described here, it's an event triggered once all widgets have been rendered:

var search = instantsearch({...});
search.on('render', function() {
   // FIXME
});

You could also create a custom widget and do a specific action in the render method.

发布评论

评论列表(0)

  1. 暂无评论