There are no built-in methods in FancyBox, so you have to modify the plugin. I took the liberty of making minor changes and posting the demo in a demo, open any image in the FancyBox popup window, and then press Enter on the keyboard. He will upload all the images to the gallery and start from the first.
Modified line 887, then insert line up to 892:
$.fancybox.pos = function(pos, array) {
if (busy) {
return;
}
if (array) { currentArray = array; }
So basically add “array” as a parameter to the function, then add a line if (array)....
To use it, just call the function poswhile the FancyBox is open. This is the code from the demo:
$.fancybox.pos(0, $('#examples a[id]'));
* Note. At first, I used $('a[id]')and included an image that was inside a fantasy.
. , , ajax... , URL- . URL-, :
<div id="ajax-loaded" style="display:none">
<a href="#" title="image1 title"><img src="image1.jpg"></a>
<a href="#" title="image2 title"><img src="image2.jpg"></a>
...
<a href="#" title="imageN title"><img src="imageN.jpg"></a>
</div>
jquery $('#ajax-content img') $.fancybox.pos ()
$.fancybox.pos( 0, $('#ajax-loaded a') );
# 2. HTML jQuery , , , .