Tagged: 

Viewing 10 posts - 1 through 10 (of 10 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

    #1330762

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

    #1330765

    Hi,

    Thank you for the info.

    Why did you add the echo function before each line? We placed a closing PHP tag after declaring the function name so that we could embed the script tag directly. Anyway, we adjusted the code in the functions.php file a bit and added a selector for the icon link (.av_font_icon a). This should work correctly now.

    Please make sure to purge the cache or do a hard refresh before testing the page. The page should reload after clicking the close button.

    Best regards,
    Ismael

    #1330997

    Hi Ismael,
    I thank you for your help.
    After checking my site, I notice that I’m no more able to click the close (x) button. Actually, the lightbox window is bigger that the window screen. Very weird …
    Could you please check the page again ?
    Kind regards
    Jorge

    #1331061

    Hi Ismael,
    After checking the theme options, I notice that the Lightbox Modal Window option was disabled. Once enabled, the modal window is opening as expected. But the page do not reload after clicking the close button.
    Hopefully, I founded a workaround : WPUF gives the ability to redirect to a custom URL (or page) after submitting a form.
    Unfortunately, the redirection occurred into Modal Windows.
    So, I have to give up the Lightbox option. Too bad !!!
    I really appreciate your support and your availability :-)
    Many thanks for your help.
    Best regards
    Jorge

    #1331445

    Hi,

    Great! Glad to know that you have found a workaround. Feel free to open another thread if you need anything else. We will close this thread for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Lightbox’ is closed to new replies.