在阅读完文档后,我设法使用以下代码手动调用打开url (图像)
$.nmManual(this.href);但现在我想手动调用nyroModal图库过滤器,到目前为止还没有任何结果。我试图在.nmManual()回调中推入过滤器gallery,但它什么也做不了。
发布于 2012-02-08 15:51:52
我通过手动调用来处理此需求,并使用了以下解决方法:
<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();
});
}
});我希望这能对你有所帮助。
https://stackoverflow.com/questions/9176326
复制相似问题