nicolafranchini/VenoBox

trigger click gallery

Rich-Tee opened this issue · 0 comments

Venobox is fantastic but I have an issue that I cant understand...
I have a need to open a venobox from within a javascript function using trigger( "click" )
when opening a data-gall gallery via trigger( "click" ) it takes a considerable amount of time to function correctly.
Please see :
http://herbandvegplanters.co.uk/veno1.htm - venobox opening a gallery as it should, perfect.
Now see :
http://herbandvegplanters.co.uk/veno2.htm
this simple example uses the $(document).ready(function() to open the gallery using trigger( "click" ),
as you can see everything is slowed down and works eventually.

any idea why this might be ?
many thanks in advance.
R Tee


An update.... the data-gall using trigger( "click" ) seems slow to load and move to the next image, so I have begun digging in the code.
Each page has 4 images of around the same file size,
when the data-gall is opened normally using test page veno1.htm, the function to preload image ( function preloadFirst ) inside venobox.js is fired once (see console).
In the test page veno2.htm the same preload image function is fired 10 times ! (see console).