baguetteBox.js
baguetteBox.js copied to clipboard
Load image as BLOB dynamically
I've got a situation where I need to request the large image (not the thumbnail that is shown before clicking) as a BLOB from the server. This is done because the request needs to contain a Bearer token (something like this: https://stackoverflow.com/a/40597843). I only do this when the user clicks to only load the images that have been requested. This href
of the link contains a placeholder until the click event happens and then gets replaced with the blob of the server call result. BaguetteBox does not reflect this change of the href
attribute and still only shows the loading indicator.
Is there any way to make BaguetteBox load the image src from a specific server call? Something like a callback that can be defined which is called when baguettebox needs the next image and that returns the src
value?