I am new here and not a lot of coding experience,
I am creating an interactive “Building” image map using image map pro plugin in WordPress, the goal is to have a shape trigger an Elementor Pop Up.
If you visit https://davenuevallarta.com/UNITS/ and click on Get Price List you can see the pop up works correctly. The pop up has Open By Selector (a[href=”#PH08″]), and the button targets (#PH08).
enter image description here
But according to the support team of the image map plugin, I need to use JS function to trigger this action. I can insert a JS in each shape, currently i have console.log(‘Pop-up link clicked2’) and when clicking on the image that says PH-08 the console displays the message correctly.
enter image description here
I dont know how to make the next step, the actual triggering of my pop up.
PS if you have any suggestions or alternatives on how to create the interactive building section I’m all ears. The idea is to create something like this one https://quartier.mx/
Thank you very much! 🙂
I tryed the following code
`<script type="text/javascript">
jQuery(document).ready(function($) {
// Función para abrir el pop-up
function openPopup() {
$('a[href="#PH08"]').click();
}
// Asigna el evento click a la forma específica
$('#shape-id').on('click', function() {
openPopup();
});
});
`
Returned the following error
`Uncaught SyntaxError: Unexpected token '<'
at Plugin.performClickAction (image-map-pro.min.js?ver=5.6.9:4:76169)
at Plugin.handleEventEnd (image-map-pro.min.js?ver=5.6.9:4:64926)
at HTMLDocument.<anonymous> (image-map-pro.min.js?ver=5.6.9:4:52172)
at HTMLDocument.dispatch (jquery.min.js?ver=3.7.1:2:40035)
at v.handle (jquery.min.js?ver=3.7.1:2:38006)`
David Granados is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.