Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在目标不在jQuery Mobile上工作的情况下进行照片扫描_Javascript_Jquery_Photoswipe - Fatal编程技术网

Javascript 在目标不在jQuery Mobile上工作的情况下进行照片扫描

Javascript 在目标不在jQuery Mobile上工作的情况下进行照片扫描,javascript,jquery,photoswipe,Javascript,Jquery,Photoswipe,我正在jQuery手机页面中使用Photo Swipe()。 我想显示加载图像的缩略图视图。 单击缩略图,将用户带到已启用滑动功能的图库,该图库占据屏幕高度的30%。 我想展示一些其他内容的底部。 我正在使用Photosweep版本3.0.5,并尝试指定目标。但他没有回应。 下面是js文件和使用的代码 <head> <script type="text/javascript" src="photoswipe/klass.min.js"></script> &

我正在jQuery手机页面中使用Photo Swipe()。 我想显示加载图像的缩略图视图。 单击缩略图,将用户带到已启用滑动功能的图库,该图库占据屏幕高度的30%。 我想展示一些其他内容的底部。 我正在使用Photosweep版本3.0.5,并尝试指定目标。但他没有回应。 下面是js文件和使用的代码

<head>

<script type="text/javascript" src="photoswipe/klass.min.js"></script>
<script type="text/javascript" src="photoswipe/code.photoswipe.jquery-3.0.5.min.js"><script>
<script>        
$(document).ready(function(){ 
  var myPhotoSwipe = $("#Gallery a").photoSwipe({ 
  enableMouseWheel: false , 
  enableKeyboard: false 
  }); 
}); 
</script>

</head>
<body>
    <div data-role = "page" data-add-back-btn = "true" id = "mainGallery">
        <div data-role = "header" data-theme = "a">
            <h1>Gallery</h1>            
        </div>
        <div data-role = "content" data-theme = "c">
            <p>Hi... I am the Photo Gallery</p>
            <div class = "gallery-wrap">
                <ul class = "gallery" id="Gallery" data-role = "listview" data-inset = "true"> 
                    <li><a href="images/full/001.jpg"><img src="images/thumb/001.jpg" alt="Image 001" /></a></li> 
                    <li><a href="images/full/002.jpg"><img src="images/thumb/002.jpg" alt="Image 002" /></a></li> 
                </ul> 
            </div>
        </div>
        <div data-role="footer" data-theme = "c" data-position="fixed">
            <h4>&copy; 2013</h4>
        </div>
    </div>      
</body>

$(文档).ready(函数(){
var myphotosweep=$(“#图库a”).photosweep({
enableMouseWheel:错误,
启用键盘:false
}); 
}); 
画廊
嗨。。。我是照片库

&抄袭;2013
我对jQuery Mobile非常陌生。有人能帮我吗

谢谢你用这个

(function(window, $, PhotoSwipe){
        $(document).ready(function(){

            $('div.gallery-page')
                .live('pageshow', function(e){

                    var 
                        currentPage = $(e.target),
                        options = {},
                        photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options,  currentPage.attr('id'));

                    return true;

                })

                .live('pagehide', function(e){

                    var 
                        currentPage = $(e.target),
                        photoSwipeInstance = PhotoSwipe.getInstance(currentPage.attr('id'));

                    if (typeof photoSwipeInstance != "undefined" && photoSwipeInstance != null) {
                        PhotoSwipe.detatch(photoSwipeInstance);
                    }

                    return true;

                });

        });

    }(window, window.jQuery, window.Code.PhotoSwipe));

希望这将有助于使用下面的图库div脚本

Gallery

你好。。。我是照片库

  • ©;2013年

    $('div.gallery-page')
    .live('pageshow',函数(e){

    var
    currentPage=$(e.target),

    options={},

    PhotosweepInstance=$(“ul.gallery a”,

    Photoswip(选项,currentPage.attr('id');

    返回true;

    })


    )

    谢谢你的回复。我已经编辑了我实际使用的代码。你能帮我修改一下吗。我尝试了你的代码,但没有成功
    $('div.gallery-page').on('pagehide', function(e){
                            PhotoSwipe.unsetActivateInstance(instance);
                            PhotoSwipe.detatch(instance); 
                            return true;
    
                        })