Bootstrap Gallery with Lightbox

喜夏-厌秋 提交于 2019-12-24 01:54:08

问题


I'm using the ekko lightbox along with bootstrap modal to create a gallery. However I cant seem to get the image navigation controls to appear/work like they do on this example: http://ashleydw.github.io/lightbox/#image-gallery

As you can see when you hover over an image you get navigation control arrows. I've tried adding the data attribute data-gallery="multiimages" to my images but this hasnt helped.

You can see my development code here: http://agtdesigns.co.uk/bootstrap-gallery/

Any help appreciated,

tia


回答1:


I had the same problem, see https://github.com/ashleydw/lightbox/issues/33 for the answer.

In summary, you need to add a wrapping div, eg

<div class="gallery">

Then as JS code

$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
        event.preventDefault();
        return $(this).ekkoLightbox({
            always_show_close: true,
            gallery_parent_selector: '.gallery',
    });
});


来源:https://stackoverflow.com/questions/26445620/bootstrap-gallery-with-lightbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!