Search code examples
twitter-bootstrapbootstrap-lightbox

bootstrap lightbox not showing image


I am trying to implement lightbox for the gallery page in the working site.I followed the steps exactly as demonstrated the bootstrap lightbox page demo http://www.jasonbutz.info/bootstrap-lightbox/#usage and also youtube video https://www.youtube.com/watch?v=J-EZC46hOc8 However my lightbox is not working. Plz help me My code is as follows:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<link href="bootstrap-lightbox.css" rel="stylesheet">
<script src="bootstrap-lightbox.js"></script>

These are files included in head section. The code in body section is as:

<div class="row">
    <div class="container">

        <div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
        <div class='lightbox-content'>
                <img src="img-3.png">
                  <div class="lightbox-caption"><p>Your caption here</p></div>
        </div>
         </div>
      <div class="col-lg-3">
         <a data-toggle="lightbox" href="#demoLightbox" class="thumbnail">Open Lightbox
                <img src="img-3.png">
        </a>
      </div>


    </div>
</div>

I get error as: Uncaught TypeError: this.hideWithTransition is not a function Plz help where is wrong with the code.


Solution

  • Try removing class "hide" from:

    <div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
    

    it works for me.