Skip to content
Snippets Groups Projects
Select Git revision
  • e3e7e1af2d31c2a4cfba63fb2e70f3a87cdaa467
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

lightbox.js

Blame
  • Forked from Stud.IP / Stud.IP
    3109 commits behind the upstream repository.
    user avatar
    Jan-Hendrik Willms authored
    a3da1483
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    lightbox.js 788 B
    $(document)
        .on('click', 'a[href][data-lightbox]', function() {
            var gallery = $(this).data().lightbox,
                elements = $(this),
                images = [],
                index = 0;
    
            if (gallery) {
                elements = $('a[href][data-lightbox="' + gallery + '"]');
                index = elements.index(this);
            }
    
            elements.each(function() {
                images.push({
                    src: $(this).attr('href'),
                    title: $(this).data().title || $(this).attr('title')
                });
            });
    
            STUDIP.Lightbox.setImages(images);
            STUDIP.Lightbox.show(index);
    
            return false;
        })
        .on('resize', function() {
            STUDIP.Lightbox.init();
        });
    
    STUDIP.domReady(function () {
        STUDIP.Lightbox.init();
    });