图像的自动幻灯片放映在Phonegap中不起作用

时间:2014-02-27 06:18:54

标签: javascript jquery cordova

嗨我想在特定的持续时间内进行图像幻灯片放映,这些图像位于我的图像文件夹中。 使用以下代码,图像不会显示。我无法弄清楚问题,为什么图像没有显示..

请在phonegap我是新手,建议我怎么做 -

<!DOCTYPE html>
<html>
<head>
    <title>PhotoSwipe</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <meta name="apple-mobile-web-app-capable" content="yes" />

    <link href="styles.css" type="text/css" rel="stylesheet" />
    <link href="css/photoswipe.css" type="text/css" rel="stylesheet" />

 </head>
 <body>
    <script type="text/javascript" src="js/klass.min.js"></script>
    <script type="text/javascript" src="js/code.photoswipe-3.0.4.min.js"></script>
    <script type="text/javascript"></script>
      <div id="MainContent">
        <div class="page-content">
            </br>
            <h1>PhotoSwipe</h1>
        </div>
        <ul id="Gallery" class="gallery">
            <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>
            <li><a href="images/full/003.jpg"><img src="images/thumb/003.jpg" alt="Image 003" /></a></li>
            <li><a href="images/full/004.jpg"><img src="images/thumb/004.jpg" alt="Image 004" /></a></li>
            <li><a href="images/full/005.jpg"><img src="images/thumb/005.jpg" alt="Image 005" /></a></li>
            <li><a href="images/full/006.jpg"><img src="images/thumb/006.jpg" alt="Image 006" /></a></li>
            <li><a href="images/full/007.jpg"><img src="images/thumb/007.jpg" alt="Image 007" /></a></li>
            <li><a href="images/full/008.jpg"><img src="images/thumb/008.jpg" alt="Image 008" /></a></li>
            <li><a href="images/full/009.jpg"><img src="images/thumb/009.jpg" alt="Image 009" /></a></li>
            <li><a href="images/full/010.jpg"><img src="images/thumb/010.jpg" alt="Image 010" /></a></li>
            <li><a href="images/full/011.jpg"><img src="images/thumb/011.jpg" alt="Image 011" /></a></li>
            <li><a href="images/full/012.jpg"><img src="images/thumb/012.jpg" alt="Image 012" /></a></li>
            <li><a href="images/full/013.jpg"><img src="images/thumb/013.jpg" alt="Image 013" /></a></li>
            <li><a href="images/full/014.jpg"><img src="images/thumb/014.jpg" alt="Image 014" /></a></li>
            <li><a href="images/full/015.jpg"><img src="images/thumb/015.jpg" alt="Image 015" /></a></li>
            <li><a href="images/full/016.jpg"><img src="images/thumb/016.jpg" alt="Image 016" /></a></li>
            <li><a href="images/full/017.jpg"><img src="images/thumb/017.jpg" alt="Image 017" /></a></li>
            <li><a href="images/full/018.jpg"><img src="images/thumb/018.jpg" alt="Image 018" /></a></li>
        </ul>
    </div>

      <script>
          (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>

 </body>
 </html>

1 个答案:

答案 0 :(得分:0)

你可以选择最适合的http://swipejs.com/。人们已经成功地将它与jQuery Mobile一起使用。

另请尝试:http://tympanus.net/codrops/2011/07/05/fullscreen-slideshow-with-html5-audio/

它包含带音频的幻灯片。