1

我正在尝试使用blueimp 库,并且我相信我已经根据需要输入了所有代码片段,但是当我单击图像时,它们仍然没有加载控件。

cat index.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<link rel="stylesheet" href="css/blueimp-gallery.min.css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/blueimp-gallery.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<script src="js/blueimp-gallery.min.js"></script>
</head>
<body>
<div class="container-fluid">
        <div class="row-fluid">
                <div class="span12">
                        <div class="page-header">
                                <h1>
                                        test <small>test</small>
                                </h1>
                        </div>
<div id="blueimp-gallery" class="blueimp-gallery">
    <div class="slides"></div>
    <h3 class="title"></h3>
    <a class="prev">‹&lt;/a>
    <a class="next">›&lt;/a>
    <a class="blueimp-gallery-display"></a>
    <a class="close">×</a>
    <ol class="indicator"></ol>
</div>
<script src="js/init.js"></script>
<div id="links">
<A HREF="images/photo1.jpg"> <IMG HEIGHT=50 WIDTH=50 SRC="images/photo1.jpg"></A>
<A HREF="images/photo2.jpg"> <IMG HEIGHT=50 WIDTH=50 SRC="images/photo2.jpg"></A>
<A HREF="images/photo3.jpg"> <IMG HEIGHT=50 WIDTH=50 SRC="images/photo3.jpg"></A>
<A HREF="images/photo4.jpg"> <IMG HEIGHT=50 WIDTH=50 SRC="images/photo4.jpg"></A>
</div>
                </div>
        </div>
</div>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cat js/init.js
var links = document.getElementById('links').getElementsByTagName('a'),
    options = {
        // Start an automatic slideshow with a delay of 5 seconds between slides:
                 interval: 5000,
        // Set to true to initialize the Gallery with carousel specific options:
                  carousel: false
                displayClass: 'blueimp-gallery-display',
                controlsClass: 'blueimp-gallery-controls',
                singleClass: 'blueimp-gallery-single',                  
                leftEdgeClass: 'blueimp-gallery-left',
                rightEdgeClass: 'blueimp-gallery-right',
                enableKeyboardNavigation: true,
                closeOnEscape: true,
                   },
                  gallery = blueimp.Gallery(links, options);

我以前使用过一些轻量级的引导程序,这似乎在功能上不一样,或者我只是忽略了一些东西。

4

1 回答 1

8

您需要设置类blueimp-gallery-controls

<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
于 2013-07-17T09:31:46.827 回答