Tagged: ,

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

    Hi,

    I realize this is likely outside of the regular support, but it’s something I’m trying to achieve with the site, to satisfy a client requirement so would definitely appreciate any ideas you might have as experts with the theme.

    On my front page I have a button that opens a youtube video, the youtube video opens in the enfold lightbox.
    If a user clicks the cross at the top right of lightbox , the lightbox closes and they are taken back to the front page.
    or if they click anywhere off the light box they are also taken back to the front page.

    I want to promote a signup to my newsletter as soon as they’ve finished watching the video.

    I am thinking the easiest way to do this would be to pop up something when the lightbox is exited (either because someone pressed the cross, or because someone clicked off the screen).

    Can anyone give me any idea how I might do this? if it involves a plug in suggestion that’s fine also,

    if you can tell me some code that I might be able to get to trigger when the lightbox closes that might be handy too.

    I am looking for the simplest solution to achieve this, many thanks

    #651891

    Hey spleeky,

    I’m not sure if that would be possible or not but send us a link to the site in question and we’ll have a closer look.

    Thanks,
    Rikard

    #662475

    Thanks Rikard, have added the link in the private content area below.

    #663702

    Hi,

    Thank you for the link. Maybe, something like this will work:

    // custom script
    add_action('wp_footer', 'add_custom_script');
    function add_custom_script(){
    ?>
    <script>
    (function($){
    	function a() {
    		if( $.avia_utilities.isMobile ) return;
    		$('.mfp-close, .mfp-iframe-holder').click( function() {
    			console.log('trigger popup');
    			// do more things here
    		});
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Add the code in the functions.php file. It will trigger an event once the close button or anywhere in the mfp-iframe-holder container is clicked.

    Best regards,
    Ismael

    #665035

    Thank you Ismael i will try this in the next week or so once I have the rest of the site complete, and let you know how I got on!

    Thanks as always for the excellent support.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.