Togging Modal from Link

Hello,

Trying to figure out how to open a modal from a link click… tried using this solution (Content Area Modal open on click) with PRO…any ideas as to why it is not working?

Hi Del,

Thanks for writing to us.

Add this part of code in a Text element.
<a class="open-modal-button" href="#">Text</a>

Now add this id my-content-area at Id field of Content Area Modal element.
After that add this code in Theme option -> JS.

jQuery( function($){
  $('.open-modal-button').on( 'click', function(e){
        e.preventDefault();
	    $('#my-content-area-anchor-toggle')[0].click();
	});
});

Please note that since this is a custom code that changes the default behaviour/display of the theme, you will be responsible to maintain or update the code in case you require further changes or if the code stops working in future updates. If you are uncertain how to proceed, it would be best to consult with a developer.

Hope it helps you.
Thanks

Hey Del,

Your post reply has been withdrawn. The issue may have been resolved already.

Cheers.

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