jquery.instagramFeed icon indicating copy to clipboard operation
jquery.instagramFeed copied to clipboard

Adding event hooks

Open ADavidLiu opened this issue 6 years ago • 11 comments
trafficstars

Great plugin!

Is there any way I can execute custom code when the plugin finishes loading the posts (like onEnd or something similar)?

ADavidLiu avatar Sep 08 '19 04:09 ADavidLiu

There is no way yet, I might implement it in a future release

jsanahuja avatar Sep 09 '19 17:09 jsanahuja

This would be a very good enhancement, as I would like to implement a slider/carousel plugin but I can't get the plugin to fire "after" yours...so this would be great!

terryapodaca avatar Jan 29 '20 08:01 terryapodaca

A pull request implementing this will be welcome. Would be good to have the following events:

  • on ready: after displaying the html
  • on load: after the onload event of every image
  • on error: if the request fails or happens whats described in #51 #50 #49 #42 #25

jsanahuja avatar Jan 29 '20 18:01 jsanahuja

Hi, any update on this?

andy00087 avatar Jul 09 '20 17:07 andy00087

The on ready is now the callback. The on error will be implemented soon. The on load can't be implemented (decently) until the template generation is made using the HTML API

jsanahuja avatar Jul 09 '20 17:07 jsanahuja

Thanks! I will try to use callback to "fire" the Instagram feed inside a slider.

andy00087 avatar Jul 09 '20 17:07 andy00087

Hi, i tried using callback but it didn`t work. Can you provide an example of it? @jsanahuja

rafael-marques avatar Aug 25 '20 20:08 rafael-marques

Check the example 7 of the docs. Note that callback can be used to render the feed yourself or, if container is defined, as an onready event

jsanahuja avatar Aug 26 '20 00:08 jsanahuja

Hi, thanks for the reply.

I did that but it didnt work. I have a containerand I'am using thecallbackasonready`.

Does it depends on the version od the pulgin I'm using?

rafael-marques avatar Aug 26 '20 13:08 rafael-marques

Yes, before 1.3.1 the callback is not triggered unless get_data is true and container is not defined.

If you can't get it working with this version please show your code

jsanahuja avatar Aug 26 '20 14:08 jsanahuja

Hi, I updated and it worked. Thanks,

rafael-marques avatar Sep 04 '20 11:09 rafael-marques