I have been struggling to integrate photoswipe.js for swiping images in my project, but unfortunately the swipe functionality is not working as expected.
head
<script type="text/javascript" src="js/klass.min.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/code.photoswipe-3.0.4.min.js"> </script>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, true);
function onDeviceReady() {
// related functions
alert("check");
$("#Gallery a").photoSwipe();
}
(function(window, PhotoSwipe){
document.addEventListener('DOMContentLoaded', function(){
var
options = {},
instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), options );
}, false);
}(window, window.Code.PhotoSwipe));
</script>
body
<ul id="Gallery" class="gallery">
<li><a href="img/img1.jpg"><img src="img/img1.jpg" rel="external" alt="" /> </a></li>
<li><a href="img/img2.jpg"><img src="img/img2.jpg" rel="external" alt="" /></a></li>
</ul>
If anyone can provide insights on where I might have gone wrong, it would be greatly appreciated. Thank you in advance!