javascript - How to close a Fancybox after gallery is fully played? -
on page images open fancybox (multiple sets of images), autoplay set true. stop fancybox after images shown (number of images vary). tried
aftershow: function () { $.fancybox.close(); }
this works stops fancybox right after first image. need aftershowgallery. there way achieve this? welcome.
i think should try calling close()
within onplayend()
event handler. event handler gets called after slideshow has stopped. instead of putting close
call in aftershow
event handler; in onplayend()
follows:
$(document).ready(function() { $('.imagen').click(function(e){ e.preventdefault(); parent.$.fancybox( [ {href:'img/1a.jpg'}, {href:'img/1b.jpg'}, {href:'img/1c.jpg'} ], { // api options here onplayend: function () { $.fancybox.close(); } } ); }); });
Comments
Post a Comment