Posts

Showing posts with the label fancybox-3

Can't close fancybox after automatic open on page load

Can't close fancybox after automatic open on page load I have a problem with fancybox that opens automatically on page load. After I click the close button the fancybox opens again. Could you help me out please? jQuery(function($){ $(".popup-wrapper").fancybox({ 'padding': '0', 'max-width': '50%', 'max-height': '50%', 'autoSize': false, 'transitionIn': 'fade', 'transitionOut': 'fade', }); $(".popup-wrapper").trigger('click'); }); css: .popup-wrapper { display: none; width: 50%; height: auto; img { width: 80%; height: auto; } } the php & html <?php $args = array('post_type' => 'popup', 'showposts' => 5,); $the_query = new WP_Query( $args ); ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); $meta = get_post_meta( $post->ID, 'popup_details', true ); ?> <?...