William Ortega

My feedback

  1. 34 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  Feature Requests & Ideas  ·  Flag idea as inappropriate…  ·  Admin →

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    William Ortega commented  · 

    I add this option with jQuery:

    /** JS **/
    gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);

    if ($('.pswp__button--autoplay').length === 0)
    $('<button class="pswp__button pswp__button--autoplay" title="AutoPlay"></button>').insertAfter('.pswp__button--zoom');

    var _autoplayId = null;
    $('.pswp__button--autoplay').on('click', function(event) {
    event.preventDefault();
    if (_autoplayId) {
    clearInterval(_autoplayId);
    _autoplayId = null;
    $('.pswp__button--autoplay').removeClass('stop');
    } else {
    _autoplayId = setInterval(function() { gallery.next(); }, 3000);
    $('.pswp__button--autoplay').addClass('stop');
    }
    });

    /** CSS **/
    .pswp__button--autoplay {
    background: transparent url(play_icon.png) no-repeat scroll 16px 16px !important;
    }
    .pswp__button--autoplay.stop {
    background-image: url(stop_icon.png) !important;
    }

Feedback and Knowledge Base