Я решил эту проблему с помощью ручного вызова и использовал этот обходной путь:
<div style="display:none;">
<?php $i=0; ?>
<?php foreach ($Gallery as $item): ?>
<?php if ($item->hasPhoto()): ?>
<a id="photo<?php echo $i ?>" href="<?php echo $item->getRelativePhotoPath() ?>" class="photo_gallery" title="<?php echo $item->getCaption() ?>" rel="gal"></a>
<?php $i++; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
$(document).ready(function() {
// #photo_gallery is the css selector of the anchor link used to start the gallery
if ($('#photo_gallery').length != 0 && $('.photo_gallery').length != 0)
{
$('.photo_gallery').nyroModal();
$('#photo_gallery').click(function(e) {
e.preventDefault();
$('#photo0').click();
});
}
});
Надеюсь, это поможет вам.