End of Year Sale: 30% off your first year on annual plans. Use code AP5-30-OFF See plans

Gallery Modal JS

1 min read
function apppCustomModal(event) {
    
    $ = jQuery;
    
    event.preventDefault();
    
    $('.gallery-modal-image').attr( 'src',  '' );

    var UpClasses   = 'slide-in-up-add ng-animate slide-in-up slide-in-up-add-active';
    var downClasses = 'slide-in-up-remove slide-in-up-remove-active';

    //get href of button that matches id of modal div
    var ImageURL = $(this).attr('href');

    // need to move .css to css file
    $('#gallery-modal').css('display', 'block').removeClass(downClasses).addClass(UpClasses);
    
    setTimeout(function() { 
        $('.gallery-modal-image').attr( 'src',  ImageURL );
    }, 300 );

}

jQuery(document).on('ready load_ajax_content_done', function($) {
    jQuery('.gallery-icon a').on( 'click', apppCustomModal );
});
WordPress

iOS & Android app builder for WordPress

Ready to build your app?

Turn your WordPress site into iOS and Android apps with push notifications on every plan.

AppPresser End of Year Sale: 30% off AppPresser subscriptions, now through Dec 31. Two phones show sample news and events apps built with AppPresser.

End of Year Sale

30% off your first year

On Standard, Professional and Advanced annual plans. Enter the code at checkout. Ends December 31, 2026 at 11:59 PM ET.

Code AP5-30-OFF
See pricing