NanoGallery2 - 自动触发灯箱
NanoGallery2 - triggering lightbox automatically
在图像列表(相册)中 - 单击将打开灯箱。
我希望灯箱在页面加载时自动触发。
这是我的代码,我正在使用 "openOnStart": "ID1",
定位第一张图片
<div ID="ngy2p" data-nanogallery2='{
"thumbnailWidth": "200",
"thumbnailLabel": {
"position": "overImageOnBottom",
"display": false,
"openOnStart": "ID1",
"titleMultiLine": true,
"descriptionMultiLine": true
},
"thumbnailHoverEffect2": "imageScale150|imageScale150",
"thumbnailAlignment": "center",
"displayBreadcrumb": false,
"thumbnailOpenImage": true
}'>
<a href="/uploads/gallery/F9GEO.JPG" data-ngid="ID1"
target="_blank" data-ngdesc=""><img src="/uploads/gallery/thumbs/F9GEO.JPG"
border="0" alt="" /></a>
<a href="/uploads/gallery/zQsFE.JPG" data-ngid="ID2"
target="_blank" data-ngdesc=""><img src="/uploads/gallery/thumbs/zQsFE.JPG"
border="0" alt="" /></a>
</div>
您可以通过更改哈希轻松触发它:
$("#ngy2p").on( 'galleryRenderEnd.nanogallery2', function(){
window.location.hash = '#nanogallery/ngy2p/0/ID1';
});
查看工作示例:
https://jsfiddle.net/ao3czrsw/
在图像列表(相册)中 - 单击将打开灯箱。 我希望灯箱在页面加载时自动触发。
这是我的代码,我正在使用 "openOnStart": "ID1",
定位第一张图片
<div ID="ngy2p" data-nanogallery2='{
"thumbnailWidth": "200",
"thumbnailLabel": {
"position": "overImageOnBottom",
"display": false,
"openOnStart": "ID1",
"titleMultiLine": true,
"descriptionMultiLine": true
},
"thumbnailHoverEffect2": "imageScale150|imageScale150",
"thumbnailAlignment": "center",
"displayBreadcrumb": false,
"thumbnailOpenImage": true
}'>
<a href="/uploads/gallery/F9GEO.JPG" data-ngid="ID1"
target="_blank" data-ngdesc=""><img src="/uploads/gallery/thumbs/F9GEO.JPG"
border="0" alt="" /></a>
<a href="/uploads/gallery/zQsFE.JPG" data-ngid="ID2"
target="_blank" data-ngdesc=""><img src="/uploads/gallery/thumbs/zQsFE.JPG"
border="0" alt="" /></a>
</div>
您可以通过更改哈希轻松触发它:
$("#ngy2p").on( 'galleryRenderEnd.nanogallery2', function(){
window.location.hash = '#nanogallery/ngy2p/0/ID1';
});
查看工作示例: https://jsfiddle.net/ao3czrsw/