imgリンクを使用してPhotoSwipeギャラリーを開く解決策を探しています。ギャラリーのアイコンが付いた IMG があります。そして、ユーザーがそれをクリックすると、ギャラリーが開きます。
どうすればそれを処理できるか誰かに考えがありますか?
私はこれを見つけました。しかし、これはロード時にギャラリーを開きます。
<script type="text/javascript">
(function(window, PhotoSwipe){
document.addEventListener('DOMContentLoaded', function(){
var
options = {
preventHide: true
},
instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), options );
instance.show(0);
}, false);
}(window, window.Code.PhotoSwipe));
</script>
よろしくお願いします