Video keeps playing after closing Modal

I know that has been solved in some threads already, but my problem is a bit different, because I do not open the modal via a button but by using a JS.

jQuery ( document ).on(“click touchend”, “#mapleft .mapsvg-marker”, function(e) {
e.preventDefault();
jQuery("#details-left-anchor-toggle").click();
} );

When I activate the “Load / reset on element toggle” at the modal, the contents (dynamic iframe content) are not loaded at all using the JS. And if I deactivate the “Load / reset on element toggle” it loads the content but the videos keep playing (audio only) in the background after closing the modal until another modal is opened using the same method.

Anything I can add to the JS or to the close button of the modal to initiate a reset of the modal without activating “Load / reset on element toggle”?

Best regards

Hi @mircotripoczky,

Thanks for writing to us.

Regretfully, we only offer support on the available options in our theme and plugins.

Using Custom JS code is part of customization and we dont offer support to that.
If you still need help, you can avail of our newly launched service One, where any customization questions are answered.

Hope it will help.

Thanks

Hm… I was hoping for help here, because the script and method I use was once (or twice) mentioned here by the staff (e.g. Content Area Modal open on click). If the event of toggling can be called by JS it is somehow be part of the theme functionality, or? :slight_smile:

Best regards.

Hi @mircotripoczky,

Please check the class, ids you used in your code and that matches the HTML rendered on your website.
If you have followed the way explained in the thread you mentioned, you could have achieved it.
I tried the same to set up the same in my testing site and seems it working.

For further help, we need to examine your site to check what the problem causes the issue.
Hope you will not mind too sharing your credentials at our secure note.

Please create a secure note with the following info:

– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/docs/getting-support

Thanks

Hi @mircotripoczky,

Please enable the Load / reset on element toggle option, because that is how the video will stop when the modal is closed, and I can not find your Content Area Modal element anywhere on your page.

Please keep in mind that the code provided on the other thread is only a guide and it is your responsibility to take it from there especially if you’re going to use it with a 3rd party plugin. The code provided in there works just fine with a button element and the content area modal element.

Thanks,

Hi,

when enabling the “Load / reset…” the trigger opens the modal, but is not loading the content into the iframe that’s there inside (inside the modal).

The modal you’ll find as shown at the screenshot… when at the editor of the homepage use the “Layout”-tab and at “Row 3” at the “Eight countries” section you’ll find the two modals (one for the left and one for the right map). The JS that triggers the modals you’ll find at the usual spot at the editor.

I know that it works great with buttons, but if it can be triggered by a specific element (by ID or by class) it should also be possible to “call” for a reset of a modal somehow when closing it.

If there is no way to trigger the reset of the modal when closing it using JS then maybe I need to find a way to load the content in a different way.

Please let me know, if you have another idea.

Best regards

Hello @mircotripoczky,

Happy Birthday!!!

Anyways, I have checked your page and I found out that you used our Content Area element and have inserted this shortcode: [mapsvg id="2188"]. You also used Content Area Modal and have inserted only this: <div id="mapdetails-left"></div>. This means that the contents were loaded by a 3rd party plugin MapSVG. Please understand that any content loaded a 3rd party plugin, the theme has no control over it. You may need to contact the creators of this plugin for further assistance instead. They should be able to give you a solution to your plugin related issue.

Thank you very much for your kind understanding.

Thanks.

I understand that you can’t give support for a 3rd party plugin.

But is there a way to trigger a reset of the modal by clicking on the modals close button, which is somehow part of the theme?

Best regards

Found a solution. Simple but effective.
By clicking the modals close button, I just call a JS that empties the desired element:

jQuery( function($){
	$('.x-modal-close').on( 'click', function(e){
        e.preventDefault();
	    $("#if").empty();
	});
});

Best regards.

Hey @mircotripoczky,

We’re glad that you’ve figured a solution for your case.

Just to be clear, the codes written in our theme are considered parts of it. Any additions like workarounds and code suggestions here that fix or enhance the theme on the fly are NOT parts of it therefore we will not support them.

Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.