How to use a lightbox in bootstrap 3?

I need an internal popup, so I am planning on using bootstrap-Lightbox. Thing is, I followed this tutorial , but it doesn't seem to work.

I just made the base:

            <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 works and I get the following 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 some kind of death why it doesn't work? And if you know why can you give me a small example of what should I do? Thanks in advance.

+3


source to share


1 answer


I recently tried something to make images friendlier. Anyway, in my experience I have used this jquery plugin

Lightbox 2 plugin but I had some trouble managing the empty div constantly showing up when I changed the select option, then I found out that Fancybox was the solution and was actually very easy to deal with.



Fancybox Plugin There are many examples you can find, so I hope the plugin is a solution.

0


source







All Articles