Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1330292

    Hi,
    I would like to reload parent page after closing lightbox window.
    How can I do ?
    Kind regards
    Jorge

    #1330412

    Hey Jorge,

    Thank you for the inquiry.

    That option is not available by default but it can done using a custom script. Why do you have to reload the page?

    This is an example of the script that reloads the page after clicking the lightbox close button (mfp-close).

    
    // reload the page on lightbox close
    function ava_custom_script(){
    	?>
    	<script>
    	(function($) {
    		$(document).ready(function() {
    			$(".avia_image").on("click", function() {
    				setTimeout(function() {
    					$(".mfp-wrap").on("click", function(e) {
    						var target = e.target;
    						if(target.classList.contains("mfp-close")) {
    							location.reload();
    						}
    					});
    				}, 500);
    			});
    		});
    	})(jQuery);
    	</script>
    	<?php
    	}
    add_action('wp_footer', 'ava_custom_script');
    

    Best regards,
    Ismael

    #1330486

    Hey Ismael,
    First, I would like to thank you for your response.
    My purpose is to allow users to update each textbox existing on a page. User can update each textbox with a WPUF form profile displayed in a lightbox. So when a user updates a textbox, i have to refresh parent page after closing lightbox to display updated data.
    Just to let you, I copy/paste your script and nothing happens. I put some ‘echo’ and no trace ;-)
    Kind regards
    Jorge

    #1330553

    Hi,

    Thank you for the clarification.

    Where can we check the page? Please provide the URL in the private field. You may need to purge the cache and remove the browser history before checking the page. Also, please note that the script will only work when you actually click the close (x) button.

    Best regards,
    Ismael

    #1330612

    Hi Ismael,
    Please find in the private field all technical informations.
    Many thanks for your help.
    King regards
    Jorge

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.