Pro 4.3.3 Modal failing to Trigger with JavaScript

Hey guys,

I’m running into a problem trying to dynamically open a modal.

e.g.

In the older version of Pro, we could use the code below to open the modal - but in the current version of Pro, this trick no longer seems to work.

jQuery(’#simple-anchor-toggle’).trigger(‘click’)

With a slight modification of the code, you can get the toggle to activate but the popup still doesn’t launch.

jQuery(’#simple-anchor-toggle’)[0].click()

Do you have the latest solution for this?

Thanks,

Matt

Seems to be a race condition going on;

setTimeout(function(){jQuery(’#simple-anchor-toggle’)[0].click()}, 100);

Wrapping the function with a timeout seemed to resolve this issue.

But please, can you come back with a better solution if you have one?

Hi Mj,

Thanks for reaching out!

This sounds like it could be the same as the issues we’ve been seeing but providing custom code is outside the scope of our theme support. I suggest that you may use your setTimeOut function option or you can avail One where we can answer questions outside of the features of our theme.

Thank you for understanding.

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