How to use lightbox in bootstrap 3?

992 views Asked by At

I need an internal popup so i'm planning to use bootstrap-Lightbox. The fact is that i followed this tutorial but it doesn't seems to work.

I only did the basis :

            <div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
            <div class='lightbox-content'>
                <img src="/ressources/images/ciel.jpg">

            </div>
        </div>



        <a data-toggle="lightbox" href="#demoLightbox" class=" span2 thumbnail">

            <img src="/ressources/images/ciel.jpg">
        </a>

But nothing pops and i get these errors :

Uncaught TypeError: Cannot read property 'offsetWidth' of undefined bootstrap.min.js:6
Uncaught TypeError: Object [object Object] has no method 'hideWithTransition' 

Do you have any diea why this is not working? And if you know why can you please give me a little example of what i have to do? Thanks by advance.

1

There are 1 answers

0
Karla Danitza Duran Memijes On

recently I tried something to make images displaying more friendly. Anyway, in my experience I used this jquery plugin

Lightbox 2 plugin but I had some issues to manage a blank div that constantly appeared when I changed a select-option, then I found out that Fancybox was the solution and in fact was very easy to deal with.

Fancybox plugin There are a lot of examples that you can find, so I hope that plugin be a solution.