-
AuthorPosts
-
September 28, 2015 at 7:11 pm #510364
Hi. I have a video that loads in a modal.
I’ve put in a notification shortcode on my page with a custom css “.comeback-message”. How can i trigger the notification to show whenever the user hits the close button of the video modal?
Thanks so much in advance!
September 28, 2015 at 8:22 pm #510388Hi nbfc!
May we have temporary admin access to your website so we can see how exactly your notification is set up?
It really sounds like you will need custom code in order to achieve the functionality you want. If that is the case you can enlist the aid of a freelancer here.
Cheers!
DakeSeptember 28, 2015 at 8:28 pm #510390Hi Dake,
Thanks for looking into this. Unfortunately my website is inside our dev environment hence won’t be accessible outside of my company’s network. However i think i’m almost there. I have a custom php function that i think just needs a little bit of tweaking in order to work. Essentially, my goal is to use the built-in magnific close “button” as the trigger to show the notification. The notification is created using the built-in enfold notification shortcode with a custom css “comeback-message”. below is the custom function:
function add_custom_notification_box(){ ?> <script> $("button.mfp-close").on('click',function(){ $(“.comeback-message”).show(); }); </script> <?php } add_action('wp_footer', 'add_custom_notification_box');
Thanks again for your help!
September 30, 2015 at 7:01 am #511139Hi!
Thank you for the info. Maybe, this will work:
function add_custom_notification_box(){ ?> <script> (function($) { $(".mfp-close").on('click',function(){ $(".comeback-message").show(); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_notification_box');
Or use .toggle instead of .show.
Best regards,
IsmaelSeptember 30, 2015 at 4:03 pm #511633Hi Ismael,
Thanks for the suggestion but unfortunately it’s still not working. The .comeback-message is not showing up after i close the magnific popup video. I tired using the .show and .toggle but still no luck.October 1, 2015 at 6:04 am #511942Hi,
Not sure if I have any further advice to give you, it’s very hard to give you accurate code/help if we can’t inspect the page. Is there any way you can upload something on a publicly accessible server somewhere?
Best regards,
RikardOctober 1, 2015 at 6:52 pm #512359Hi Rikard,
Thank you for your effort in helping me. I’ve decided to try a different approach hence won’t be needing this feature anymore. Maybe i’ll put this on the backburner for now and hopefully in the future someone here will be able to provide a solution.
-
AuthorPosts
- The topic ‘trigger a notification shortcode’ is closed to new replies.