2016-09-11 6 views
0

zu arbeiten Ich versuche, diese Galerie auf einer Website zu implementieren: http://ashleydw.github.io/lightbox/Wie kommt man Leuchtkasten für Bootstrap 3

Es gibt keine Anweisungen, damit ich ziemlich verloren habe, habe versucht, es zu bekommen zu arbeiten.

Ich kopierte, was weiter unten noch mehr oder weniger aus dem Quellcode aus dem obigen Link. in einen neuen Ordner dist/Leuchtkasten (z ekko-lightbox.css, ekko-lightbox.js)

zog ich alle Dateien im Github Download enthalten.

Es ist nicht etwas zu tun, wenn Sie auf ein Bild klicken, wird es einfach die URL Bild.

Was fehlt mir? Muss ich mit anderen Dateien verlinken oder was ist falsch?

<head> 
<!-- leaving out the other stuff here --> 
<link href="dist/lightbox/ekko-lightbox.css" rel="stylesheet"> 
<link href="dist/css/bootstrap.css" rel="stylesheet"> 
<link href="dist/css/custom.css" rel="stylesheet"> 
</head> 
<body> 
<!-- this is from the source code, just updated the images --> 
    <h3 class="page-header" id="image-gallery">Example #2: Gallery of Images</h3> 
<p>By default, gallery images must be wrapped in a tag (probably <code>&lt;div&gt;</code>) - which doesn't have the class <code>.row</code>. This is so you can create columns/rows.</p> 
<p>A custom selector for the parent can be used, see <a href="#wrappers">example #11</a>. Note how the final image is not in the gallery intentionally.</p> 
<div class="row"> 
    <div class="col-md-offset-2 col-md-8"> 
     <div class="row"> 
      <a href="images/DSC00978.jpeg" data-toggle="lightbox" data-gallery="multiimages" data-title="People walking down stairs" class="col-sm-4"> 
       <img src="images/DSC00978.jpeg" class="img-responsive" 
      </a> 
      <a href="images/DSC00978.jpeg" data-toggle="lightbox" data-gallery="multiimages" data-title="Man getting wet" class="col-sm-4"> 
       <img src="images/DSC00978.jpeg" class="img-responsive"> 
      </a> 
      <a href="images/DSC00978.jpeg" data-toggle="lightbox" data-gallery="multiimages" data-title="Someone lost their dress" class="col-sm-4"> 
       <img src="images/DSC00978.jpeg" class="img-responsive"> 
      </a> 
     </div>  
    </div> 
    </div> 

    <script type="text/javascript"> 
    $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) { 
event.preventDefault(); 
$(this).ekkoLightbox(); 
}); 

     $(document).ready(function ($) { 
      // delegate calls to data-toggle="lightbox" 
      $(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click', function(event) { 
       event.preventDefault(); 
       return $(this).ekkoLightbox({ 
        onShown: function() { 
         if (window.console) { 
          return console.log('Checking our the events huh?'); 
         } 
        }, 
     onNavigate: function(direction, itemIndex) { 
         if (window.console) { 
          return console.log('Navigating '+direction+'. Current item: '+itemIndex); 
         } 
     } 
       }); 
      }); 

      //Programatically call 
      $('#open-image').click(function (e) { 
       e.preventDefault(); 
       $(this).ekkoLightbox(); 
      }); 
      $('#open-youtube').click(function (e) { 
       e.preventDefault(); 
       $(this).ekkoLightbox(); 
      }); 

    // navigateTo 
      $(document).delegate('*[data-gallery="navigateTo"]', 'click', function(event) { 
       event.preventDefault(); 

       var lb; 
       return $(this).ekkoLightbox({ 
        onShown: function() { 

         lb = this; 

     $(lb.modal_content).on('click', '.modal-footer a', function(e) { 

      e.preventDefault(); 
      lb.navigateTo(2); 

     }); 

        } 
       }); 
      }); 


     }); 
    </script> 

    <!-- Bootstrap core JavaScript 
    ================================================== --> 
    <!-- Placed at the end of the document so the pages load faster --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
    <script>window.jQuery || document.write('<script src="assets/js/vendor/jquery.min.js"><\/script>')</script> 
    <script src="dist/js/bootstrap.min.js"></script> 
    <script src="js/modal.js"></script> 
    <script src="dist/lightbox/ekko-lightbox.min.js"></script> 
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> 
    <script src="assets/js/ie10-viewport-bug-workaround.js"></script> 
    </body> 
    </html> 

Antwort

Verwandte Themen