Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.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 1.4.2+;Photosweep 1.0.11_Javascript_Jquery_Jquery Ui_Jquery Mobile_Jquery Plugins - Fatal编程技术网

Javascript jQuery Mobile 1.4.2+;Photosweep 1.0.11

Javascript jQuery Mobile 1.4.2+;Photosweep 1.0.11,javascript,jquery,jquery-ui,jquery-mobile,jquery-plugins,Javascript,Jquery,Jquery Ui,Jquery Mobile,Jquery Plugins,我正在尝试用最新版本的jQuery Mobile实现最新版本的Photoswip。我甚至使用了包含在Photoswip下载文件中的已经制作好的示例,我正在将jQuery和jQuery mobile更新到最新版本。完成此操作后,库立即不工作。有人设法让它工作了吗 如果这是不可能的,那么有什么好的替代方案可以与最新的jQuery Mobile配合使用呢 最好的方法是继续使用Photosweep。您的问题是版本不匹配。最初的开发人员在几周前停止了这个框架的工作,另一个开发人员取代了这个项目。但是不知道

我正在尝试用最新版本的jQuery Mobile实现最新版本的Photoswip。我甚至使用了包含在Photoswip下载文件中的已经制作好的示例,我正在将jQuery和jQuery mobile更新到最新版本。完成此操作后,库立即不工作。有人设法让它工作了吗

如果这是不可能的,那么有什么好的替代方案可以与最新的jQuery Mobile配合使用呢


最好的方法是继续使用Photosweep。您的问题是版本不匹配。最初的开发人员在几周前停止了这个框架的工作,另一个开发人员取代了这个项目。但是不知道的是,第二个开发者很久以前就开始了这个项目,这个插件有两个不同的版本

最初的一个在两年前停止使用jQuery Mobile。第二个实现目前拥有3.0.5版本。不幸的是,此版本不再可用。据我所知,第二个开发人员正在将这两个项目合并在一起

谢天谢地,我有可用的3.0.4版

工作示例:

HTML:
确保在
pagecontainershow
上初始化插件。
<!DOCTYPE html>
<html>
    <head>
        <title>jQM Complex Demo</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
        <link rel="stylesheet" href="http://www.photoswipe.com/latest/photoswipe.css" />        
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
        <script src="http://thecodingwebsite.com/tutorials/photoswipe/klass.min.js"></script>            
        <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>            
        <script src="http://thecodingwebsite.com/tutorials/photoswipe/code.photoswipe.jquery-3.0.4.min.js"></script>    
    </head>
    <body>
        <div data-role="page" id="index">
            <div data-theme="b" data-role="header">
                <h1>Index page</h1>
            </div>

            <div data-role="content">
                <ul class="gallery">           
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/001.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/001.jpg" alt="Image 001" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/002.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/002.jpg" alt="Image 002" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/003.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/003.jpg" alt="Image 003" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/004.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/004.jpg" alt="Image 004" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/005.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/005.jpg" alt="Image 005" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/006.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/006.jpg" alt="Image 006" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/007.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/007.jpg" alt="Image 007" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/008.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/008.jpg" alt="Image 008" /></a></li>
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/009.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/009.jpg" alt="Image 009" /></a></li>
                </ul>
            </div>
        </div>    
    </body>
</html>   
$(document).on('pagebeforeshow', '#index', function(){   
    var myPhotoSwipe = $(".gallery li a").photoSwipe({
        jQueryMobile: true,
        loop: false,
        enableMouseWheel: false,
        enableKeyboard: false
    });

    myPhotoSwipe.show(0);      
});