jquerry lightbox blocked [?]

Hi guys!

When I'm trying to use lightbox on single image (from href) I get a jqeryy working after 1st click (which has no action on href)

<a href="assets/img/4.2_2D.jpg"><i class="glyphicon glyphicon-eye-open"></i></a>

used the

$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) { event.preventDefault(); $(this).simpleLightbox(); });


I'm sure that I've messed sth but I can't solve it by myself so your help will be much appreciated.


You have a javascript error that is stopping the lightbox function you have in your script file from being executed.

script.min.js:formatted:3656 Uncaught TypeError: Cannot read property 'outerWidth' of undefined
    at n.fn.init._calcItemPositions (script.min.js:formatted:3656)
    at n.fn.init._placeItems (script.min.js:formatted:3766)
    at n.fn.init._handleFiltering (script.min.js:formatted:3754)
    at n.fn.init.filter (script.min.js:formatted:3478)
    at Object.init (script.min.js:formatted:3470)
    at n.fn.init.e.fn.filterizr (script.min.js:formatted:3409)
    at o.<anonymous> (script.min.js:formatted:4261)
    at o.e.emitEvent (script.min.js:formatted:3129)
    at o.complete (script.min.js:formatted:3268)
    at o.check (script.min.js:formatted:3252)
    at o.<anonymous> (script.min.js:formatted:3175)

Starting on line 3656 in Chrome's Dev Tools ( F12 or CRTL+Shift+i or right click on page and select Inspect) window when the script.min.js is formatted (unminimized).

If I take your little bit of lightbox script from your post and execute it in Chrome's Dev Tools Console, I can then click on the EyE icon for a lightbox window. It does take an initial second click though per icon, that could be related to the JS error not sure about it though.


Thank you @Saj! Yes, it works only with a 2nd click... This [violation] also appears in the table - https://www.chromestatus.com/feature/5745543795965952

Definitely I messed up with a jquerry - I've put the line form my 1st post line into js of the filterable gallery from this BootsrapStudio item ( http://imagia-mu.com/DEV/BS/filterable-gallery ) and... messed it all ;)

Thanks! Best regards